summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqkzk <qu3nt1n@gmail.com>2023-03-10 22:24:23 +0100
committerqkzk <qu3nt1n@gmail.com>2023-03-10 22:24:23 +0100
commitc6fc8772769d982e57178a77d727a2aa5640bc1f (patch)
treeb714fb8f0d2090855b9d414fa5140969802d39f9
parent89a86729f286a840f21e1258a10098e3604eec71 (diff)
clippy
-rw-r--r--development.md19
-rw-r--r--src/bulkrename.rs2
-rw-r--r--src/skim.rs2
-rw-r--r--src/utils.rs10
4 files changed, 11 insertions, 22 deletions
diff --git a/development.md b/development.md
index fc4be65..6d748f9 100644
--- a/development.md
+++ b/development.md
@@ -434,16 +434,13 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
- [x] Remove lazygit as a separate command
- [x] Allow configuration from a config file
- - [ ] allow non tui like wttr, diff, bat, tail -n etc.
- - [ ] more options like "use flagged files" for diff
- - [ ] exec multiple flagged files
- [x] display full command before execution
- [x] changing folder (`set_pathcontent`) should set the cwd too... but it has no effect on commands
- [x] FIX: code, subl etc. won't show in exec completion
- [x] when executable are filtered only files are kept, not symbolink links.
- [x] better error messages when a config file can't be loaded
- - [ ] messages to display what was made after executing an action
+ - [x] messages to display what was made after executing an action
- [x] improve logging configuration, config from a yaml file moved at build to `$HOME/.config/fm/logging_config.yaml`
- [x] use 2 separate loggers, normal and for specific actions
@@ -456,18 +453,16 @@ New view: Tree ! Toggle with 't', fold with 'z'. Navigate normally.
- [x] symlinks creation
- [x] trash add, trash delete, trash empty
- - [ ] marks creation (?)
- - [ ] set wallpaper (?)
- - [ ] mocp add to playlist (?)
-
- - [ ] execution (???)
- - [ ] opening (???)
- - [ ] open in nvim (???)
-
- [x] colors in menus. Use a repeated gradient of lime colors in menus
- [ ] Version 0.1.20
+ - [ ] exec multiple flagged files
+ - [ ] shell menu
+
+ - [ ] allow non tui like wttr, diff, bat, tail -n etc.
+ - [ ] more options like "use flagged files" for diff
+
- [ ] replace FmResult & FmError by anyhow since I'm already using it...
- [ ] build option to force reset of config file, warn the user at first start
- [ ] update readme & animation
diff --git a/src/bulkrename.rs b/src/bulkrename.rs
index c42842d..634a13c 100644
--- a/src/bulkrename.rs
+++ b/src/bulkrename.rs
@@ -175,7 +175,7 @@ impl<'a> Bulkrename<'a> {
Ok(())
}
- fn create_all_files(&self, new_filenames: &Vec<String>) -> FmResult<()> {
+ fn create_all_files(&self, new_filenames: &[String]) -> FmResult<()> {
let mut counter = 0;
for filename in new_filenames.iter() {
let mut new_path = std::path::PathBuf::from(self.parent_dir.unwrap());
diff --git a/src/skim.rs b/src/skim.rs
index 5948745..7a27c5a 100644
--- a/src/skim.rs
+++ b/src/skim.rs
@@ -57,7 +57,7 @@ impl Skimer {
fn pick_first_installed<'a>(commands: &'a [&'a str]) -> Option<&'a str> {
for command in commands {
- let Some(program) = command.split_whitespace().into_iter().next() else { continue };
+ let Some(program) = command.split_whitespace().next() else { continue };
if is_program_in_path(program) {
return Some(command);
}
diff --git a/src/utils.rs b/src/utils.rs
index 860e838..e9cc452 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -121,13 +121,7 @@ pub fn is_program_in_path(program: &str) -> bool {
false
}
-/// Extract the last `line_nr` lines of a string.
-/// It's really ugly.
-/// Be carefull not to use it on very big strings.
+/// Extract the lines of a string
pub fn extract_lines(content: String) -> Vec<String> {
- content
- .lines()
- .into_iter()
- .map(|line| line.to_string())
- .collect()
+ content.lines().map(|line| line.to_string()).collect()
}