Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various lints #282

Merged
merged 2 commits into from
Apr 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use ? operator instead of returning none
  • Loading branch information
jmacdonald committed Apr 7, 2024
commit 902609b7d8df796dc11fff9c34ad969967ff9580
7 changes: 2 additions & 5 deletions src/models/application/preferences/mod.rs
Original file line number Diff line number Diff line change
@@ -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.