Skip to content

Commit d234155

Browse files
UnbreakableMJclaude
andcommitted
style: cargo fmt
Format fixes for the vault-exec commit that CI's rustfmt check caught. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent b9a82e0 commit d234155

3 files changed

Lines changed: 19 additions & 14 deletions

File tree

crates/vault-cli/src/main.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,19 +1615,18 @@ fn cmd_config_exec(action: ExecConfigAction) -> Result<(), u8> {
16151615
}
16161616
Ok(())
16171617
}
1618-
ExecConfigAction::Unset {
1619-
profile,
1620-
var,
1621-
json,
1622-
} => {
1618+
ExecConfigAction::Unset { profile, var, json } => {
16231619
let mut cfg = load_config()?;
16241620
if let Err(msg) = cfg.exec_unset(&profile, &var) {
16251621
eprintln!("vault: {msg}");
16261622
return Err(2);
16271623
}
16281624
save_config(&cfg)?;
16291625
if json {
1630-
println!("{}", serde_json::json!({ "profile": profile, "unset": var }));
1626+
println!(
1627+
"{}",
1628+
serde_json::json!({ "profile": profile, "unset": var })
1629+
);
16311630
}
16321631
Ok(())
16331632
}
@@ -2124,7 +2123,10 @@ async fn cmd_exec(
21242123

21252124
match status {
21262125
Ok(status) if status.success() => Ok(()),
2127-
Ok(status) => Err(status.code().and_then(|c| u8::try_from(c).ok()).unwrap_or(1)),
2126+
Ok(status) => Err(status
2127+
.code()
2128+
.and_then(|c| u8::try_from(c).ok())
2129+
.unwrap_or(1)),
21282130
Err(e) => {
21292131
eprintln!("vault: failed to run '{program}': {e}");
21302132
Err(127)

crates/vault-config/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,11 @@ mod tests {
642642
assert_eq!(c.exec_profile("default"), None);
643643

644644
c.exec_set("default", "ANTHROPIC_API_KEY", "Anthropic API Key");
645-
c.exec_set("default", "BRAVE_API_KEY", "Brave Search API Key#custom:api_key");
645+
c.exec_set(
646+
"default",
647+
"BRAVE_API_KEY",
648+
"Brave Search API Key#custom:api_key",
649+
);
646650
let profile = c.exec_profile("default").expect("profile present");
647651
assert_eq!(
648652
profile.get("ANTHROPIC_API_KEY").map(String::as_str),
@@ -659,8 +663,7 @@ mod tests {
659663
assert_eq!(back.exec_profile("default"), c.exec_profile("default"));
660664

661665
// Unset removes just that var; the profile survives with the other.
662-
c.exec_unset("default", "ANTHROPIC_API_KEY")
663-
.expect("unset");
666+
c.exec_unset("default", "ANTHROPIC_API_KEY").expect("unset");
664667
assert_eq!(
665668
c.exec_profile("default").map(BTreeMap::len),
666669
Some(1),

crates/vault-tui/src/app.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,9 +1500,7 @@ impl App {
15001500
#[must_use]
15011501
pub fn selected_detail_field(&self) -> Option<DetailField> {
15021502
let e = self.selected_entry()?;
1503-
detail_fields(e.cipher_type)
1504-
.get(self.detail_field)
1505-
.cloned()
1503+
detail_fields(e.cipher_type).get(self.detail_field).cloned()
15061504
}
15071505

15081506
/// The `(id, name, field)` that `Space` should reveal given the current
@@ -2287,7 +2285,9 @@ mod tests {
22872285
assert!(f.masked, "{label} must be masked");
22882286
}
22892287
assert_eq!(
2290-
id.iter().find(|f| f.label == "SSN").map(|f| f.field.clone()),
2288+
id.iter()
2289+
.find(|f| f.label == "SSN")
2290+
.map(|f| f.field.clone()),
22912291
Some(Field::IdentitySsn)
22922292
);
22932293
}

0 commit comments

Comments
 (0)