diff --git a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/persistence.rs b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/persistence.rs index c27336066..7a4e44507 100644 --- a/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/persistence.rs +++ b/apps/ai-game-creator-shell/src-tauri/src/ui_editor/commands/separation/persistence.rs @@ -141,7 +141,7 @@ fn replace_separation_state_atomically(temporary: &Path, target: &Path) -> std:: fn replace_separation_state_atomically(temporary: &Path, target: &Path) -> std::io::Result<()> { use std::os::windows::ffi::OsStrExt; use windows_sys::Win32::Storage::FileSystem::{ - MOVEFILE_REPLACE_EXISTING, MOVEFILE_WRITE_THROUGH, MoveFileExW, + MoveFileExW, MOVEFILE_REPLACE_EXISTING, MOVEFILE_WRITE_THROUGH, }; let source = temporary @@ -154,6 +154,8 @@ fn replace_separation_state_atomically(temporary: &Path, target: &Path) -> std:: .encode_wide() .chain(std::iter::once(0)) .collect::>(); + // SAFETY: both buffers are owned, UTF-16 encoded, and NUL-terminated; they + // remain alive for the duration of the call, which only reads the paths. let moved = unsafe { MoveFileExW( source.as_ptr(),