Skip to content

Commit

Permalink
clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Nov 12, 2023
1 parent b641b8b commit b41a3d0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion crates/highlighter/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ impl SyntaxHighlighter {
};
Ok(HighlightEngine::new(syntax, theme)
.highlight_line(line, &self.syntax_set, theme.settings.foreground)
.map_err(|e| Error::Syntect(e))?)
.map_err(Error::Syntect)?)
}

pub fn highlight_line(&self, extension: &str, line: &str) -> Vec<TokenHighlighterForTerminal> {
Expand Down
5 changes: 2 additions & 3 deletions crates/maple_core/src/stdio_server/plugin/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,10 @@ impl ClapPlugin for System {
let content: Vec<String> = params.parse()?;

let mut ctx: ClipboardContext =
ClipboardProvider::new().map_err(|e| PluginError::Clipboard(e))?;
ClipboardProvider::new().map_err(PluginError::Clipboard)?;
match ctx.set_contents(content.into_iter().next().unwrap()) {
Ok(()) => {
self.vim
.echo_info(format!("copied to clipboard successfully"))?;
self.vim.echo_info("copied to clipboard successfully")?;
}
Err(e) => {
self.vim
Expand Down
2 changes: 1 addition & 1 deletion crates/maple_core/src/stdio_server/provider/filer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ impl FilerProvider {
let current_items = self
.dir_entries
.get(&self.current_dir)
.ok_or_else(|| ProviderError::Other(format!("Directory entries not found")))?;
.ok_or_else(|| ProviderError::Other("Directory entries not found".to_string()))?;

let processed = current_items.len();

Expand Down
8 changes: 5 additions & 3 deletions crates/maple_core/src/stdio_server/vim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,11 @@ impl Vim {
Ok(curline)
}
}
_ => Err(VimError::GetDisplayCurLine(format!(
"Invalid return value of `s:api.display_getcurline()`, [String, Bool] expected"
))),
_ => Err(VimError::GetDisplayCurLine(
"Invalid return value of `s:api.display_getcurline()`, \
[String, Bool] expected"
.to_string(),
)),
}
}

Expand Down

0 comments on commit b41a3d0

Please sign in to comment.