Skip to content

Commit

Permalink
Merge pull request #139 from Jedsek/master
Browse files Browse the repository at this point in the history
Better code and 0 warnings from clippy
  • Loading branch information
Ninjani committed Aug 24, 2022
2 parents fa84619 + 999a57e commit 9e263b1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/gist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ pub struct Gist {

#[derive(Deserialize, Debug)]
pub struct GistFile {
filename: String,
pub content: String,
pub language: String,
}
Expand Down
4 changes: 2 additions & 2 deletions src/language.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl CodeHighlight {
theme_set
.add_from_folder(&syntect_dir)
.map_err(|_e| LostTheWay::ThemeError {
theme: String::from((&syntect_dir).to_str().unwrap()),
theme: String::from((syntect_dir).to_str().unwrap()),
})
.suggestion(format!(
"Make sure {:#?} is a valid directory that has .tmTheme files",
Expand All @@ -162,7 +162,7 @@ impl CodeHighlight {
syntax_set
.add_from_folder(&syntect_dir, true)
.map_err(|_e| LostTheWay::ThemeError {
theme: String::from((&syntect_dir).to_str().unwrap()),
theme: String::from((syntect_dir).to_str().unwrap()),
})
.suggestion(format!(
"Make sure {:#?} is a valid directory that has .sublime-syntax files",
Expand Down
5 changes: 2 additions & 3 deletions src/the_way/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl TheWay {
}
(None, None) => self.list_snippets_in_date_range(from_date, to_date),
};
let snippets = match &filters.pattern {
match &filters.pattern {
Some(pattern) => {
let regex = Regex::new(&pattern.to_string_lossy())?;
snippets.map(|snippets| {
Expand All @@ -87,7 +87,6 @@ impl TheWay {
})
}
None => snippets,
};
snippets
}
}
}
2 changes: 1 addition & 1 deletion src/the_way/search.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl SkimItem for SearchCode {
}
}

impl<'a> SkimItem for SearchSnippet {
impl SkimItem for SearchSnippet {
fn text(&self) -> Cow<str> {
AnsiString::parse(&self.text_highlight).into_inner()
+ AnsiString::parse(&self.code.code_highlight).into_inner()
Expand Down
1 change: 0 additions & 1 deletion src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ pub fn copy_to_clipboard(copy_cmd_field: &Option<String>, text: &str) -> color_e
let copy_cmd_vec = copy_cmd_field
.as_ref()
.ok_or(LostTheWay::NoDefaultCopyCommand)?
.trim()
.split_whitespace()
.map(|s| s.to_owned())
.collect::<Vec<String>>();
Expand Down

0 comments on commit 9e263b1

Please sign in to comment.