@@ -289,8 +289,8 @@ fn build_report_with_dependencies(
289289 category : ProblemCategory :: RepositoryTargeting ,
290290 severity : ProblemSeverity :: Error ,
291291 fixability : ProblemFixability :: ManualOnly ,
292- summary : "Git is not available on this machine." . to_string ( ) ,
293- remediation : "Install an accessible 'git' binary and ensure it is on PATH before rerunning 'sce doctor'." . to_string ( ) ,
292+ summary : String :: from ( "Git is not available on this machine." ) ,
293+ remediation : String :: from ( "Install an accessible 'git' binary and ensure it is on PATH before rerunning 'sce doctor'." ) ,
294294 next_action : "manual_steps" ,
295295 } ) ;
296296 Vec :: new ( )
@@ -299,8 +299,8 @@ fn build_report_with_dependencies(
299299 category : ProblemCategory :: RepositoryTargeting ,
300300 severity : ProblemSeverity :: Error ,
301301 fixability : ProblemFixability :: ManualOnly ,
302- summary : "The current repository is bare and does not support local SCE hook rollout." . to_string ( ) ,
303- remediation : "Run 'sce doctor' from a non-bare working tree clone to inspect repo-scoped SCE hook health." . to_string ( ) ,
302+ summary : String :: from ( "The current repository is bare and does not support local SCE hook rollout." ) ,
303+ remediation : String :: from ( "Run 'sce doctor' from a non-bare working tree clone to inspect repo-scoped SCE hook health." ) ,
304304 next_action : "manual_steps" ,
305305 } ) ;
306306 Vec :: new ( )
@@ -309,8 +309,8 @@ fn build_report_with_dependencies(
309309 category : ProblemCategory :: RepositoryTargeting ,
310310 severity : ProblemSeverity :: Error ,
311311 fixability : ProblemFixability :: ManualOnly ,
312- summary : "The current directory is not inside a git repository." . to_string ( ) ,
313- remediation : "Run 'sce doctor' from inside the target repository working tree to inspect repo-scoped SCE hook health." . to_string ( ) ,
312+ summary : String :: from ( "The current directory is not inside a git repository." ) ,
313+ remediation : String :: from ( "Run 'sce doctor' from inside the target repository working tree to inspect repo-scoped SCE hook health." ) ,
314314 next_action : "manual_steps" ,
315315 } ) ;
316316 Vec :: new ( )
@@ -321,8 +321,8 @@ fn build_report_with_dependencies(
321321 category : ProblemCategory :: RepositoryTargeting ,
322322 severity : ProblemSeverity :: Error ,
323323 fixability : ProblemFixability :: ManualOnly ,
324- summary : "Unable to resolve git hooks directory." . to_string ( ) ,
325- remediation : "Verify that git repository inspection succeeds and rerun 'sce doctor' inside a non-bare git repository." . to_string ( ) ,
324+ summary : String :: from ( "Unable to resolve git hooks directory." ) ,
325+ remediation : String :: from ( "Verify that git repository inspection succeeds and rerun 'sce doctor' inside a non-bare git repository." ) ,
326326 next_action : "manual_steps" ,
327327 } ) ;
328328 Vec :: new ( )
@@ -379,7 +379,7 @@ fn collect_global_state_health(
379379 severity : ProblemSeverity :: Error ,
380380 fixability : ProblemFixability :: ManualOnly ,
381381 summary : format ! ( "Unable to resolve expected state root: {error}" ) ,
382- remediation : "Verify that the current platform exposes a writable SCE state directory before rerunning 'sce doctor'." . to_string ( ) ,
382+ remediation : String :: from ( "Verify that the current platform exposes a writable SCE state directory before rerunning 'sce doctor'." ) ,
383383 next_action : "manual_steps" ,
384384 } ) ,
385385 }
@@ -415,7 +415,7 @@ fn collect_global_state_health(
415415 severity : ProblemSeverity :: Error ,
416416 fixability : ProblemFixability :: ManualOnly ,
417417 summary : format ! ( "Unable to resolve expected global config path: {error}" ) ,
418- remediation : "Verify that the current platform exposes a writable SCE config directory before rerunning 'sce doctor'." . to_string ( ) ,
418+ remediation : String :: from ( "Verify that the current platform exposes a writable SCE config directory before rerunning 'sce doctor'." ) ,
419419 next_action : "manual_steps" ,
420420 } ) ,
421421 }
@@ -465,7 +465,7 @@ fn collect_global_state_health(
465465 severity : ProblemSeverity :: Error ,
466466 fixability : ProblemFixability :: ManualOnly ,
467467 summary : format ! ( "Unable to resolve expected Agent Trace local DB path: {error}" ) ,
468- remediation : "Verify that the SCE state root can be resolved on this machine before rerunning 'sce doctor'." . to_string ( ) ,
468+ remediation : String :: from ( "Verify that the SCE state root can be resolved on this machine before rerunning 'sce doctor'." ) ,
469469 next_action : "manual_steps" ,
470470 } ) ;
471471 None
@@ -493,7 +493,7 @@ fn inspect_agent_trace_db_health(
493493 "Agent Trace local DB path '{}' has no parent directory." ,
494494 db_health. path. display( )
495495 ) ,
496- remediation : "Verify that the SCE state root resolves to a normal filesystem path before rerunning 'sce doctor'." . to_string ( ) ,
496+ remediation : String :: from ( "Verify that the SCE state root resolves to a normal filesystem path before rerunning 'sce doctor'." ) ,
497497 next_action : "manual_steps" ,
498498 } ) ;
499499 return ;
@@ -1241,7 +1241,7 @@ fn run_auto_fixes(
12411241 fix_results. push ( DoctorFixResultRecord {
12421242 category : ProblemCategory :: HookRollout ,
12431243 outcome : FixResult :: Failed ,
1244- detail : "Automatic hook repair could not start because the repository root was not resolved during diagnosis." . to_string ( ) ,
1244+ detail : String :: from ( "Automatic hook repair could not start because the repository root was not resolved during diagnosis." ) ,
12451245 } ) ;
12461246 return fix_results;
12471247 } ;
@@ -1273,7 +1273,7 @@ fn run_filesystem_auto_fixes(
12731273 return vec ! [ DoctorFixResultRecord {
12741274 category: ProblemCategory :: FilesystemPermissions ,
12751275 outcome: FixResult :: Failed ,
1276- detail: "Automatic Agent Trace directory repair could not start because the expected local DB path was not resolved during diagnosis." . to_string ( ) ,
1276+ detail: String :: from ( "Automatic Agent Trace directory repair could not start because the expected local DB path was not resolved during diagnosis." ) ,
12771277 } ] ;
12781278 } ;
12791279
@@ -1464,7 +1464,10 @@ mod tests {
14641464
14651465 impl Drop for TestDir {
14661466 fn drop ( & mut self ) {
1467- let _ = fs:: remove_dir_all ( & self . path ) ;
1467+ // Best-effort cleanup in test harness; ignore errors since we can't propagate them
1468+ if let Err ( e) = fs:: remove_dir_all ( & self . path ) {
1469+ eprintln ! ( "Warning: Failed to clean up test directory: {e}" ) ;
1470+ }
14681471 }
14691472 }
14701473
@@ -1489,7 +1492,7 @@ mod tests {
14891492 severity : ProblemSeverity :: Error ,
14901493 fixability : ProblemFixability :: AutoFixable ,
14911494 summary : summary. to_string ( ) ,
1492- remediation : "Run 'sce doctor --fix'." . to_string ( ) ,
1495+ remediation : String :: from ( "Run 'sce doctor --fix'." ) ,
14931496 next_action : "doctor_fix" ,
14941497 }
14951498 }
0 commit comments