Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Fix clippy let_and_return in with_runtime

Amrithesh Kakkoth Entebdae699d22cb
diff --git a/mobile/apps/photos/rust/src/ml/runtime.rs b/mobile/apps/photos/rust/src/ml/runtime.rs
index de9c363842..a0865310fe 100644
--- a/mobile/apps/photos/rust/src/ml/runtime.rs
+++ b/mobile/apps/photos/rust/src/ml/runtime.rs
@@ -337,15 +337,13 @@ where
let fallback_config = cpu_only_runtime_config(config);
rt_log(&format!("execution provider failed, retrying with CPU-only runtime: {first_error}"));
ensure_runtime(&fallback_config)?;
- let retry_result = {
+ {
let guard = read_runtime();
let state = guard
.as_ref()
.ok_or_else(|| MlError::Runtime("runtime is not initialized".to_string()))?;
func(&state.runtime)
- };
-
- retry_result
+ }
}
}
}