@@ -209,12 +209,12 @@ impl Index {
209209 . namespaces
210210 . by_ns
211211 . get_mut ( namespace)
212- . ok_or_else ( || anyhow:: anyhow!( "namespace not found: {}" , namespace ) ) ?;
212+ . ok_or_else ( || anyhow:: anyhow!( "namespace not found: {namespace}" ) ) ?;
213213 let pod = ns
214214 . pods
215215 . by_name
216216 . get_mut ( pod)
217- . ok_or_else ( || anyhow:: anyhow!( "pod {}.{} not found" , pod , namespace ) ) ?;
217+ . ok_or_else ( || anyhow:: anyhow!( "pod {pod }.{namespace } not found" ) ) ?;
218218 Ok ( pod
219219 . port_server_or_default ( port, & self . cluster_info )
220220 . watch
@@ -235,14 +235,12 @@ impl Index {
235235 . namespaces
236236 . by_ns
237237 . get_mut ( namespace)
238- . ok_or_else ( || anyhow:: anyhow!( "namespace not found: {}" , namespace) ) ?;
239- let external_workload =
240- ns. external_workloads
241- . by_name
242- . get_mut ( workload)
243- . ok_or_else ( || {
244- anyhow:: anyhow!( "external workload {}.{} not found" , workload, namespace)
245- } ) ?;
238+ . ok_or_else ( || anyhow:: anyhow!( "namespace not found: {namespace}" ) ) ?;
239+ let external_workload = ns
240+ . external_workloads
241+ . by_name
242+ . get_mut ( workload)
243+ . ok_or_else ( || anyhow:: anyhow!( "external workload {workload}.{namespace} not found" ) ) ?;
246244 Ok ( external_workload
247245 . port_server_or_default ( port, & self . cluster_info )
248246 . watch
@@ -1195,7 +1193,7 @@ impl PodIndex {
11951193 // Pod labels and annotations may change at runtime, but the
11961194 // port list may not
11971195 if pod. port_names != port_names {
1198- bail ! ( "pod {} port names must not change" , name ) ;
1196+ bail ! ( "pod {name } port names must not change" ) ;
11991197 }
12001198
12011199 // If there aren't meaningful changes, then don't bother doing
@@ -2060,9 +2058,7 @@ impl PolicyIndex {
20602058 . and_then ( |ns| ns. meshtls . get ( name) )
20612059 . ok_or_else ( || {
20622060 anyhow ! (
2063- "could not find MeshTLSAuthentication {} in namespace {}" ,
2064- name,
2065- namespace
2061+ "could not find MeshTLSAuthentication {name} in namespace {namespace}"
20662062 )
20672063 } ) ?;
20682064 tracing:: trace!( ids = ?authn. matches, "Found MeshTLSAuthentication" ) ;
@@ -2111,11 +2107,7 @@ impl PolicyIndex {
21112107 continue ;
21122108 }
21132109 }
2114- bail ! (
2115- "could not find NetworkAuthentication {} in namespace {}" ,
2116- name,
2117- namespace
2118- ) ;
2110+ bail ! ( "could not find NetworkAuthentication {name} in namespace {namespace}" ) ;
21192111 }
21202112 }
21212113
0 commit comments