diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-18 13:22:14 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-18 13:22:14 +0200 |
| commit | 7edb7f578d5e87a4d9e28586c2e066269041cc1d (patch) | |
| tree | c8b01fcbaac4b9c39f76ea743149d020a03c1625 /src | |
| parent | 8d11eb64efa67f1d7a6902300fdffd2c7c08df6c (diff) | |
Apply formatting
Diffstat (limited to 'src')
| -rw-r--r-- | src/command/add_remote.rs | 4 | ||||
| -rw-r--r-- | src/command/publish.rs | 4 | ||||
| -rw-r--r-- | src/command/publish_archive.rs | 5 | ||||
| -rw-r--r-- | src/command/status/configuration_status.rs | 2 | ||||
| -rw-r--r-- | src/template.rs | 23 |
5 files changed, 14 insertions, 24 deletions
diff --git a/src/command/add_remote.rs b/src/command/add_remote.rs index d22d484..7824af9 100644 --- a/src/command/add_remote.rs +++ b/src/command/add_remote.rs @@ -21,8 +21,8 @@ impl super::Command for AddRemote { configuration: &Configuration, _: &str, ) -> Result<()> { - let input = input - .ok_or_else(|| Error::other("You must provide a location for the remote."))?; + let input = + input.ok_or_else(|| Error::other("You must provide a location for the remote."))?; add( &configuration.config_directory, &configuration.remote_config, diff --git a/src/command/publish.rs b/src/command/publish.rs index 4b174de..e203f62 100644 --- a/src/command/publish.rs +++ b/src/command/publish.rs @@ -23,8 +23,8 @@ impl super::Command for Publish { configuration: &Configuration, _: &str, ) -> Result<()> { - let input = input - .ok_or_else(|| Error::other("You must provide a location to publish the blog"))?; + let input = + input.ok_or_else(|| Error::other("You must provide a location to publish the blog"))?; Command::new(COMMAND) .arg("--version") diff --git a/src/command/publish_archive.rs b/src/command/publish_archive.rs index 289b0c8..0d1bca5 100644 --- a/src/command/publish_archive.rs +++ b/src/command/publish_archive.rs @@ -23,9 +23,8 @@ impl super::Command for PublishArchive { configuration: &Configuration, _: &str, ) -> Result<()> { - let input = input.ok_or_else(|| { - Error::other("You must provide a location to publish the archive") - })?; + let input = input + .ok_or_else(|| Error::other("You must provide a location to publish the archive"))?; Command::new(COMMAND) .arg("--version") diff --git a/src/command/status/configuration_status.rs b/src/command/status/configuration_status.rs index 4a01768..5b847d1 100644 --- a/src/command/status/configuration_status.rs +++ b/src/command/status/configuration_status.rs @@ -61,8 +61,6 @@ mod tests { #[cfg(windows)] use std::os::windows::fs::PermissionsExt; - - use test_utilities::*; use super::*; diff --git a/src/template.rs b/src/template.rs index 1a00fe2..05c5db4 100644 --- a/src/template.rs +++ b/src/template.rs @@ -117,9 +117,8 @@ impl Parsed { match token { Token::Text(contents) => rendered_template.push_str(contents), Token::DisplayDirective { content } => { - let value = ContextGetter::get(context, content).ok_or_else(|| { - Error::other(format!("{content} is not a valid key")) - })?; + let value = ContextGetter::get(context, content) + .ok_or_else(|| Error::other(format!("{content} is not a valid key")))?; rendered_template.push_str(&value.render()); } Token::ConditionalDirective { @@ -133,9 +132,8 @@ impl Parsed { condition = condition[1..].to_string(); } - let value = ContextGetter::get(context, &condition).ok_or_else(|| { - Error::other(format!("{condition} is not a valid key")) - })?; + let value = ContextGetter::get(context, &condition) + .ok_or_else(|| Error::other(format!("{condition} is not a valid key")))?; match value { Value::Bool(value) => { @@ -145,9 +143,7 @@ impl Parsed { } Ok(()) } - _ => Err(Error::other( - format!("{condition} is not a boolean value"), - )), + _ => Err(Error::other(format!("{condition} is not a boolean value"))), }?; } Token::IteratorDirective { @@ -155,9 +151,8 @@ impl Parsed { member_label, children, } => { - let value = ContextGetter::get(context, collection).ok_or_else(|| { - Error::other(format!("{collection} is not a valid key")) - })?; + let value = ContextGetter::get(context, collection) + .ok_or_else(|| Error::other(format!("{collection} is not a valid key")))?; match value { Value::Collection(collection) => { @@ -170,9 +165,7 @@ impl Parsed { } Ok(()) } - _ => Err(Error::other( - format!("{collection} is not a collection"), - )), + _ => Err(Error::other(format!("{collection} is not a collection"))), }?; } } |