Skip to content

Commit 931f7ca

Browse files
committed
style: cargo fmt
1 parent 8a3f0a5 commit 931f7ca

4 files changed

Lines changed: 19 additions & 42 deletions

File tree

‎src/commands/setup.rs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,7 @@ pub async fn handle(output: &OutputOptions) -> Result<()> {
7575
if let Some(ref key) = saved_team {
7676
config::set_default_team(Some(key))?;
7777
println!(" Default team saved: {}", key);
78-
println!(
79-
" Tip: Override with -t {} or LINEAR_CLI_TEAM={}",
80-
key, key
81-
);
78+
println!(" Tip: Override with -t {} or LINEAR_CLI_TEAM={}", key, key);
8279
} else {
8380
println!(" Invalid selection, skipping.");
8481
}

‎src/config.rs‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -806,9 +806,7 @@ mod tests {
806806
token_type: "Bearer".to_string(),
807807
scopes: vec!["read".to_string(), "write".to_string()],
808808
});
809-
config
810-
.workspaces
811-
.insert("oauth-test".to_string(), oauth_ws);
809+
config.workspaces.insert("oauth-test".to_string(), oauth_ws);
812810

813811
let toml_str = toml::to_string_pretty(&config).unwrap();
814812
let parsed: Config = toml::from_str(&toml_str).unwrap();
@@ -829,9 +827,10 @@ mod tests {
829827
current: Some("default".to_string()),
830828
..Default::default()
831829
};
832-
config
833-
.workspaces
834-
.insert("default".to_string(), Workspace::with_api_key("lin_api_key"));
830+
config.workspaces.insert(
831+
"default".to_string(),
832+
Workspace::with_api_key("lin_api_key"),
833+
);
835834

836835
let toml_str = toml::to_string_pretty(&config).unwrap();
837836
assert!(

‎src/keyring.rs‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ fn get_secret(service: &str, profile: &str, fallback_label: &str) -> Result<Opti
7070
}
7171
Err(e) => {
7272
if !crate::output::is_quiet() {
73-
eprintln!(
74-
"Warning: Keyring error ({e}), falling back to {fallback_label}"
75-
);
73+
eprintln!("Warning: Keyring error ({e}), falling back to {fallback_label}");
7674
}
7775
Ok(None)
7876
}
@@ -95,7 +93,9 @@ fn delete_secret(service: &str, profile: &str) -> Result<()> {
9593
match entry.delete_credential() {
9694
Ok(()) => Ok(()),
9795
Err(keyring::Error::NoEntry) => Ok(()),
98-
Err(e) => Err(e).with_context(|| format!("Failed to delete secret from {}", backend_name())),
96+
Err(e) => {
97+
Err(e).with_context(|| format!("Failed to delete secret from {}", backend_name()))
98+
}
9999
}
100100
}
101101

@@ -123,7 +123,10 @@ pub fn is_available() -> bool {
123123
if is_mock_entry(&entry) {
124124
return false;
125125
}
126-
!matches!(entry.get_password(), Err(keyring::Error::NoStorageAccess(_)))
126+
!matches!(
127+
entry.get_password(),
128+
Err(keyring::Error::NoStorageAccess(_))
129+
)
127130
}
128131
Err(_) => false,
129132
}

‎src/main.rs‎

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,9 +1162,7 @@ async fn run_command(
11621162
Commands::Templates { action } => templates::handle(action, output).await?,
11631163
Commands::Time { action } => time::handle(action, output).await?,
11641164
Commands::Uploads { action } => uploads::handle(action).await?,
1165-
Commands::Interactive { team } => {
1166-
interactive::run(config::resolve_team_arg(team)).await?
1167-
}
1165+
Commands::Interactive { team } => interactive::run(config::resolve_team_arg(team)).await?,
11681166
Commands::Context => handle_context(output, agent_opts, retry).await?,
11691167
Commands::Favorites { action } => favorites::handle(action, output).await?,
11701168
Commands::Roadmaps { action } => {
@@ -1592,31 +1590,11 @@ mod tests {
15921590

15931591
#[test]
15941592
fn test_should_use_pager_disabled_for_interactive_commands() {
1595-
assert!(!should_use_pager(
1596-
false,
1597-
&OutputFormat::Table,
1598-
false,
1599-
true
1600-
));
1593+
assert!(!should_use_pager(false, &OutputFormat::Table, false, true));
16011594
// Non-interactive table on TTY would still depend on is_terminal; quiet/json off.
1602-
assert!(!should_use_pager(
1603-
true,
1604-
&OutputFormat::Table,
1605-
false,
1606-
false
1607-
));
1608-
assert!(!should_use_pager(
1609-
false,
1610-
&OutputFormat::Json,
1611-
false,
1612-
false
1613-
));
1614-
assert!(!should_use_pager(
1615-
false,
1616-
&OutputFormat::Table,
1617-
true,
1618-
false
1619-
));
1595+
assert!(!should_use_pager(true, &OutputFormat::Table, false, false));
1596+
assert!(!should_use_pager(false, &OutputFormat::Json, false, false));
1597+
assert!(!should_use_pager(false, &OutputFormat::Table, true, false));
16201598
}
16211599

16221600
#[test]

0 commit comments

Comments
 (0)