Skip to content

Commit 421ebfe

Browse files
StarefossenCopilot
andcommitted
style: apply rustfmt
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 39340d0 commit 421ebfe

11 files changed

Lines changed: 26 additions & 34 deletions

File tree

src/commands/proposals/args.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ pub struct ReviewArgs {
7777

7878
impl ListArgs {
7979
pub fn has_cli_filters(&self) -> bool {
80-
self.status.is_some() || self.format.is_some() || self.sort != SortField::Created || self.asc
80+
self.status.is_some()
81+
|| self.format.is_some()
82+
|| self.sort != SortField::Created
83+
|| self.asc
8184
}
8285
}

src/commands/proposals/display.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ pub const TABLE_HEADER: &str = "STATUS FORMAT TITLE · SPEAKER";
88
pub fn format_item(p: &Proposal) -> String {
99
let speakers: Vec<&str> = p.speakers.iter().map(|s| s.name.as_str()).collect();
1010
let speaker_str = speakers.join(", ");
11-
let format = p
12-
.format
13-
.map_or("-".to_string(), |f| f.label().to_string());
11+
let format = p.format.map_or("-".to_string(), |f| f.label().to_string());
1412
let status = display::pad_and_colorize_status(p.status, 12);
1513

1614
let prefix_len = 12 + 1 + 16 + 1;

src/commands/proposals/interactive.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ use crate::client::TrpcClient;
77
use crate::types::Proposal;
88
use crate::{config, display, ui};
99

10-
use super::display::{filter_summary, format_item, TABLE_HEADER};
11-
use super::filters::{apply_filters, Filters};
10+
use super::display::{TABLE_HEADER, filter_summary, format_item};
11+
use super::filters::{Filters, apply_filters};
1212
use super::review::prompt_and_submit_review;
1313

1414
pub async fn list_interactive(client: &TrpcClient, all_proposals: &[Proposal]) -> Result<()> {
@@ -108,10 +108,7 @@ pub fn show_filter_menu(filters: &mut Filters) -> Result<()> {
108108
}
109109
})
110110
.collect();
111-
let format_labels: Vec<&str> = FORMATS
112-
.iter()
113-
.map(|f| f.label())
114-
.collect();
111+
let format_labels: Vec<&str> = FORMATS.iter().map(|f| f.label()).collect();
115112

116113
println!(
117114
"\n{}",

src/commands/proposals/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::args::SortField;
2-
use super::filters::{apply_filters, avg_rating, Filters};
2+
use super::filters::{Filters, apply_filters, avg_rating};
33
use crate::types::{Proposal, ProposalFormat, ProposalStatus};
44

55
fn make_proposal(id: &str, title: &str, status: &str, format: &str) -> Proposal {

src/commands/sponsors.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ fn filter_by_status<'a>(
7070
statuses: Option<&[SponsorStatus]>,
7171
) -> Vec<&'a SponsorForConference> {
7272
match statuses {
73-
Some(s) if !s.is_empty() => sponsors.iter().filter(|sp| s.contains(&sp.status)).collect(),
73+
Some(s) if !s.is_empty() => sponsors
74+
.iter()
75+
.filter(|sp| s.contains(&sp.status))
76+
.collect(),
7477
_ => sponsors.iter().collect(),
7578
}
7679
}
7780

78-
fn list_interactive(
79-
_client: &TrpcClient,
80-
sponsors: &[SponsorForConference],
81-
) -> Result<()> {
81+
fn list_interactive(_client: &TrpcClient, sponsors: &[SponsorForConference]) -> Result<()> {
8282
if sponsors.is_empty() {
8383
println!("No sponsors found.");
8484
return Ok(());

src/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ pub fn save_to(config: &Config, path: &Path) -> Result<()> {
4949

5050
// Write atomically: temp file → fsync → rename
5151
// This prevents corruption if the process is interrupted mid-write.
52-
let dir = path.parent().context("Config path has no parent directory")?;
52+
let dir = path
53+
.parent()
54+
.context("Config path has no parent directory")?;
5355
let tmp_path = dir.join(".config.toml.tmp");
5456

5557
{

src/display/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
mod proposal;
22
mod sponsor;
33

4-
pub use proposal::{
5-
pad_and_colorize_status, print_proposal_detail, render_proposal_detail,
6-
};
4+
pub use proposal::{pad_and_colorize_status, print_proposal_detail, render_proposal_detail};
75
pub use sponsor::{
8-
format_sponsor_row, print_sponsor_detail, print_sponsor_list, render_sponsor_detail,
9-
SPONSOR_TABLE_HEADER,
6+
SPONSOR_TABLE_HEADER, format_sponsor_row, print_sponsor_detail, print_sponsor_list,
7+
render_sponsor_detail,
108
};

src/display/proposal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::fmt::Write;
22

33
use colored::Colorize;
44

5-
use crate::types::{portable_text_to_plain, Proposal, ProposalStatus};
5+
use crate::types::{Proposal, ProposalStatus, portable_text_to_plain};
66

77
/// Render proposal details into a `String` (for scrollable views, etc.).
88
pub fn render_proposal_detail(proposal: &Proposal) -> String {

src/display/sponsor.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ pub fn print_sponsor_list(sponsors: &[SponsorForConference]) {
1919
println!("\n{} sponsors", sponsors.len());
2020
}
2121

22-
pub const SPONSOR_TABLE_HEADER: &str =
23-
"SPONSOR STATUS CONTRACT TIER";
22+
pub const SPONSOR_TABLE_HEADER: &str = "SPONSOR STATUS CONTRACT TIER";
2423

2524
pub fn format_sponsor_row(s: &SponsorForConference) -> String {
2625
let name = s.sponsor.as_ref().map_or("Unknown", |sp| sp.name.as_str());

src/main.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,9 @@ async fn main() -> Result<()> {
6565
let cli = Cli::parse();
6666

6767
match cli.command {
68-
Command::Login => {
69-
tokio::task::spawn_blocking(commands::login::run)
70-
.await
71-
.context("Login task panicked")?
72-
}
68+
Command::Login => tokio::task::spawn_blocking(commands::login::run)
69+
.await
70+
.context("Login task panicked")?,
7371
Command::Logout => commands::logout::run(),
7472
Command::Status => commands::status::run(),
7573
Command::Admin(admin) => match admin {

0 commit comments

Comments
 (0)