diff --git a/codex-rs/apply-patch/src/lib.rs b/codex-rs/apply-patch/src/lib.rs index 315a6425d0..d72e8f2e9f 100644 --- a/codex-rs/apply-patch/src/lib.rs +++ b/codex-rs/apply-patch/src/lib.rs @@ -483,7 +483,7 @@ async fn apply_hunks_to_files( write_file_with_missing_parent_retry( fs, &path_uri, - contents.clone().into_bytes(), + contents.as_bytes(), follow_symlinks, sandbox, ) @@ -594,7 +594,7 @@ async fn apply_hunks_to_files( write_file_with_missing_parent_retry( fs, &dest_uri, - new_contents.clone().into_bytes(), + new_contents.as_bytes(), follow_symlinks, sandbox, ) @@ -765,14 +765,14 @@ async fn note_existing_path_delta_support( async fn write_file_with_missing_parent_retry( fs: &dyn ExecutorFileSystem, path: &PathUri, - contents: Vec, + contents: &[u8], follow_symlinks: bool, sandbox: Option<&FileSystemSandboxContext>, ) -> anyhow::Result<()> { match fs .write_file( path, - contents.clone(), + contents.to_vec(), WriteFileOptions { follow_symlinks }, sandbox, ) @@ -799,7 +799,7 @@ async fn write_file_with_missing_parent_retry( } fs.write_file( path, - contents, + contents.to_vec(), WriteFileOptions { follow_symlinks }, sandbox, )