refactor: rename variable

pull/12902/head
Nikita Revenco 2025-02-18 12:24:45 +00:00
parent cd6584f0ab
commit 0e6e3e8aeb
1 changed files with 3 additions and 3 deletions

View File

@ -414,7 +414,7 @@ pub fn file_explorer(root: PathBuf, editor: &Editor) -> Result<FileExplorer, std
create_file_operation_prompt("create:", cx, path, |cx, _path, to_create_str| { create_file_operation_prompt("create:", cx, path, |cx, _path, to_create_str| {
let to_create = helix_stdx::path::expand_tilde(PathBuf::from(to_create_str)); let to_create = helix_stdx::path::expand_tilde(PathBuf::from(to_create_str));
let create = |to_create_str: &str, to_create: &Path| { let create_op = |to_create_str: &str, to_create: &Path| {
if to_create_str.ends_with(std::path::MAIN_SEPARATOR) { if to_create_str.ends_with(std::path::MAIN_SEPARATOR) {
if let Err(err) = fs::create_dir_all(to_create).map_err( if let Err(err) = fs::create_dir_all(to_create).map_err(
|err| format!("Unable to create directory {}: {err}", to_create.display()) |err| format!("Unable to create directory {}: {err}", to_create.display())
@ -442,12 +442,12 @@ pub fn file_explorer(root: PathBuf, editor: &Editor) -> Result<FileExplorer, std
cx, cx,
to_create_str.to_string(), to_create_str.to_string(),
to_create.to_path_buf(), to_create.to_path_buf(),
create create_op
); );
return None; return None;
}; };
create(to_create_str, &to_create) create_op(to_create_str, &to_create)
}) })
}, },
// move // move