Skip to content

Commit

Permalink
Fix various lints (#282)
Browse files Browse the repository at this point in the history
* Use a plain array to store splash screen content

* Use ? operator instead of returning none
  • Loading branch information
jmacdonald committed Apr 7, 2024
1 parent 9c8ff07 commit ffe3df7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/models/application/preferences/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,10 @@ impl Preferences {
let extension = path_extension(Some(path))?;

// Build a command using the command sub-key.
let Some(program) = self
let program = self
.data
.as_ref()
.and_then(|data| data[TYPES_KEY][extension][FORMAT_TOOL_KEY]["command"].as_str())
else {
return None;
};
.and_then(|data| data[TYPES_KEY][extension][FORMAT_TOOL_KEY]["command"].as_str())?;
let mut command = process::Command::new(program);

// Parse and add options to command, if present.
Expand Down
2 changes: 1 addition & 1 deletion src/presenters/modes/normal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn display(

presenter.present()?;
} else {
let content = vec![
let content = [
format!("Amp v{}", env!("CARGO_PKG_VERSION")),
String::from("© 2015-2024 Jordan MacDonald"),
String::from(" "),
Expand Down

0 comments on commit ffe3df7

Please sign in to comment.