diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-20 17:57:59 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-20 17:58:49 -0500 |
commit | 5e0a874ddb246cfde0030cbebeae1a049896047e (patch) | |
tree | 916fdac8bf09647b2382c1a0af59a6f56d50b80f /src/commands | |
parent | 9891eebc5d993081086ef49954dce173db9fab99 (diff) |
fix char issue with bulk_rename
Diffstat (limited to 'src/commands')
-rw-r--r-- | src/commands/bulk_rename.rs | 3 | ||||
-rw-r--r-- | src/commands/set_mode.rs | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/commands/bulk_rename.rs b/src/commands/bulk_rename.rs index 4171b01..1b1ffb4 100644 --- a/src/commands/bulk_rename.rs +++ b/src/commands/bulk_rename.rs @@ -30,7 +30,7 @@ pub fn _bulk_rename(context: &mut JoshutoContext) -> JoshutoResult<()> { rand::thread_rng() .sample_iter(&rand::distributions::Alphanumeric) .take(10) - .for_each(|ch| rand_str.push(ch)); + .for_each(|ch| rand_str.push(ch as char)); /* create this file in a temporary folder */ let mut file_path = path::PathBuf::from("/tmp"); @@ -43,6 +43,7 @@ pub fn _bulk_rename(context: &mut JoshutoContext) -> JoshutoResult<()> { None => vec![], } }; + { let mut file = std::fs::File::create(&file_path)?; for path in paths.iter() { diff --git a/src/commands/set_mode.rs b/src/commands/set_mode.rs index a13cad6..8d443ea 100644 --- a/src/commands/set_mode.rs +++ b/src/commands/set_mode.rs @@ -45,7 +45,7 @@ pub fn set_mode(context: &mut JoshutoContext, backend: &mut TuiBackend) -> Joshu let user_input = match entry { Some(entry) => { let mode = entry.metadata.permissions_ref().mode(); - let mode_string = unix::stringify_mode(mode); + let mode_string = unix::mode_to_string(mode); TuiTextField::default() .prompt(":") .prefix(PREFIX) |