Skip to content

Commit b8af899

Browse files
committed
Format with cargo fmt
This formats the repository with `cargo fmt`. The changes are very few and most of them seem to do with whitespace handling (we had some tabs sneak into our indentation).
1 parent 080c1e7 commit b8af899

File tree

7 files changed

+43
-27
lines changed

7 files changed

+43
-27
lines changed

crates/mdbook-goals/src/mdbook_preprocessor.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,10 @@ impl<'c> GoalPreprocessorWithContext<'c> {
309309
let mut old_format_asks: Vec<&TeamAsk> = vec![];
310310
let mut new_format_goals: Vec<&GoalDocument> = vec![];
311311

312-
for goal in goals.iter().filter(|g| g.metadata.status.is_not_not_accepted()) {
312+
for goal in goals
313+
.iter()
314+
.filter(|g| g.metadata.status.is_not_not_accepted())
315+
{
313316
match &goal.team_involvement {
314317
TeamInvolvement::Asks(asks) => {
315318
old_format_asks.extend(asks.iter());
@@ -324,9 +327,8 @@ impl<'c> GoalPreprocessorWithContext<'c> {
324327
let mut formatted = String::new();
325328

326329
if !old_format_asks.is_empty() {
327-
formatted.push_str(
328-
&format_team_asks(&old_format_asks).map_err(|e| anyhow::anyhow!("{e}"))?,
329-
);
330+
formatted
331+
.push_str(&format_team_asks(&old_format_asks).map_err(|e| anyhow::anyhow!("{e}"))?);
330332
}
331333

332334
if !new_format_goals.is_empty() {
@@ -731,7 +733,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
731733
&Some(end_date),
732734
None,
733735
false,
734-
Order::OldestFirst,
736+
Order::OldestFirst,
735737
)
736738
.map_err(|e| anyhow::anyhow!("Failed to generate blog post content: {}", e))?;
737739

@@ -743,9 +745,9 @@ impl<'c> GoalPreprocessorWithContext<'c> {
743745
milestone: &str,
744746
team_name: &str,
745747
) -> anyhow::Result<String> {
746-
// Look at the updates for the last ~three months
747-
let end_date = chrono::Utc::now().date_naive();
748-
let start_date = end_date - chrono::TimeDelta::days(90);
748+
// Look at the updates for the last ~three months
749+
let end_date = chrono::Utc::now().date_naive();
750+
let start_date = end_date - chrono::TimeDelta::days(90);
749751

750752
eprintln!(
751753
"👥 Generating champion report for {} team, {start_date} - {end_date} (milestone: {})",
@@ -768,7 +770,7 @@ impl<'c> GoalPreprocessorWithContext<'c> {
768770
&Some(end_date),
769771
Some(team_name),
770772
false,
771-
Order::NewestFirst,
773+
Order::NewestFirst,
772774
)
773775
.map_err(|e| anyhow::anyhow!("Failed to generate champion report content: {}", e))?;
774776

crates/rust-project-goals-cli/src/cfp.rs

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use regex::Regex;
22
use rust_project_goals::spanned::{Error, Spanned};
3-
use rust_project_goals::{spanned::Context as _, spanned::Result};
43
use rust_project_goals::util::MILESTONE_REGEX;
4+
use rust_project_goals::{spanned::Context as _, spanned::Result};
55
use std::fs::{self, File};
66
use std::io::Write;
77
use std::path::{Path, PathBuf};
@@ -575,8 +575,14 @@ mod tests {
575575
let intro_pos = result.find("[👋 Introduction]").unwrap();
576576
let goal_process_pos = result.find("# ⏳ 2026H1 goal process").unwrap();
577577
let existing_section_pos = result.find("# ⚙️ 2025H2").unwrap();
578-
assert!(intro_pos < goal_process_pos, "Goal process section should come after Introduction");
579-
assert!(goal_process_pos < existing_section_pos, "New section should come before existing dated section");
578+
assert!(
579+
intro_pos < goal_process_pos,
580+
"Goal process section should come after Introduction"
581+
);
582+
assert!(
583+
goal_process_pos < existing_section_pos,
584+
"New section should come before existing dated section"
585+
);
580586
}
581587

582588
#[test]
@@ -593,8 +599,14 @@ mod tests {
593599
let intro_pos = result.find("[👋 Introduction]").unwrap();
594600
let goal_process_pos = result.find("# ⏳ 2027 goal process").unwrap();
595601
let existing_section_pos = result.find("# ⚙️ 2025H2").unwrap();
596-
assert!(intro_pos < goal_process_pos, "Goal process section should come after Introduction");
597-
assert!(goal_process_pos < existing_section_pos, "New section should come before existing dated section");
602+
assert!(
603+
intro_pos < goal_process_pos,
604+
"Goal process section should come after Introduction"
605+
);
606+
assert!(
607+
goal_process_pos < existing_section_pos,
608+
"New section should come before existing dated section"
609+
);
598610
}
599611

600612
#[test]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
pub mod updates;
22

3-
pub use updates::{Order, render_updates};
3+
pub use updates::{render_updates, Order};

crates/rust-project-goals-cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ fn generate_updates(
238238
end_date,
239239
with_champion_from,
240240
true,
241-
updates::Order::default(),
241+
updates::Order::default(),
242242
)?;
243243

244244
if let Some(output_file) = output_file {

crates/rust-project-goals-cli/src/rfc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,9 +170,10 @@ pub fn generate_issues(
170170
if success == 0 {
171171
spanned::bail_here!("all actions failed, aborting")
172172
}
173-
173+
174174
// Clear the cached issues since we just modified them
175-
if let Err(e) = rust_project_goals::gh::issues::clear_milestone_issues_cache(&timeframe) {
175+
if let Err(e) = rust_project_goals::gh::issues::clear_milestone_issues_cache(&timeframe)
176+
{
176177
eprintln!("Warning: Failed to clear issues cache: {}", e);
177178
}
178179
} else {

crates/rust-project-goals-cli/src/updates.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ pub fn render_updates(
175175
&filter,
176176
true,
177177
use_progress_bar,
178-
comment_order,
178+
comment_order,
179179
&issue_themes,
180180
&issue_point_of_contact,
181181
&issue_team_champions,
@@ -187,7 +187,7 @@ pub fn render_updates(
187187
&filter,
188188
false,
189189
use_progress_bar,
190-
comment_order,
190+
comment_order,
191191
&issue_themes,
192192
&issue_point_of_contact,
193193
&issue_team_champions,
@@ -244,10 +244,10 @@ fn prepare_goals(
244244
comments.sort_by_key(|c| c.created_at.clone());
245245
comments.retain(|c| !c.should_hide_from_reports() && filter.matches(c));
246246

247-
// We got the comments in the chronological order. Reverse it if desired.
248-
if matches!(comment_order, Order::NewestFirst) {
247+
// We got the comments in the chronological order. Reverse it if desired.
248+
if matches!(comment_order, Order::NewestFirst) {
249249
comments.reverse();
250-
}
250+
}
251251

252252
// Prettify the comments' timestamp after using it for sorting.
253253
for comment in comments.iter_mut() {

crates/rust-project-goals/src/goal.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -691,9 +691,7 @@ fn extract_team_involvement(
691691
return Ok((TeamInvolvement::Asks(team_asks), goal_plans, task_owners));
692692
}
693693

694-
spanned::bail_here!(
695-
"no `Team asks` or `Ownership and team asks` section found"
696-
)
694+
spanned::bail_here!("no `Team asks` or `Ownership and team asks` section found")
697695
}
698696

699697
/// Extract team support entries from the new format (2026+).
@@ -827,7 +825,10 @@ impl std::fmt::Display for SupportLevel {
827825
}
828826

829827
/// Extract plan items from the old format, starting at the given section index.
830-
fn extract_plan_items_from_index(sections: &[Section], ownership_index: usize) -> Result<Vec<GoalPlan>> {
828+
fn extract_plan_items_from_index(
829+
sections: &[Section],
830+
ownership_index: usize,
831+
) -> Result<Vec<GoalPlan>> {
831832
// Extract the plan items from the main section (if any)
832833
let level = sections[ownership_index].level;
833834

0 commit comments

Comments
 (0)