Skip to content

Commit 1043bca

Browse files
committed
chore: fmt, bump 0.40.0
1 parent 26439d5 commit 1043bca

File tree

19 files changed

+85
-56
lines changed

19 files changed

+85
-56
lines changed

Cargo.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "api"
3-
version = "0.39.0"
3+
version = "0.40.0"
44
edition = "2021"
55
license = "GPL-3.0"
66
authors = ["Matthew Polak <[email protected]>"]

crates/api/src/player/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,8 +443,7 @@ impl Player {
443443
.skin
444444
.metadata
445445
.as_ref()
446-
.map(|m| m.model == "slim")
447-
.unwrap_or_default(),
446+
.is_some_and(|m| m.model == "slim"),
448447
)
449448
}) else {
450449
return Cow::Borrowed(&*DEFAULT_SKIN);

crates/derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "derive"
3-
version = "0.39.0"
3+
version = "0.40.0"
44
edition = "2021"
55
license = "GPL-3.0"
66
authors = ["Matthew Polak <[email protected]>"]

crates/statpixel/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "statpixel"
3-
version = "0.39.0"
3+
version = "0.40.0"
44
edition = "2021"
55
license = "GPL-3.0"
66
authors = ["Matthew Polak <[email protected]>"]

crates/statpixel/src/commands/at/run.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,12 @@ pub async fn guild_command(
198198
guild.increase_searches(ctx).await?;
199199

200200
let png: Option<Cow<_>> = if let snapshot::guild::Status::Found((ref guild, _)) = status {
201-
let guilds =
202-
get_snapshots_multiple_of_weekday(ctx, guild, Utc::now() - chrono::Duration::try_days(30).unwrap())
203-
.await?;
201+
let guilds = get_snapshots_multiple_of_weekday(
202+
ctx,
203+
guild,
204+
Utc::now() - chrono::Duration::try_days(30).unwrap(),
205+
)
206+
.await?;
204207
let monthly_xp = get_monthly_xp(guild, &guilds);
205208

206209
let daily_xp = guild.members.iter().map(|g| g.xp_history[1].1).sum::<u32>();

crates/statpixel/src/commands/builder/mod.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ pub fn create_components<'c>(
5757
.description(tr(ctx, "right-description")),
5858
CreateSelectMenuOption::new(tr(ctx, "right-start"), "right_start")
5959
.description(tr(ctx, "right-start-description")),
60-
].into(),
60+
]
61+
.into(),
6162
},
6263
)
6364
.placeholder(match state.next.location {
@@ -83,7 +84,8 @@ pub fn create_components<'c>(
8384
.description(tr(ctx, "bubble-description")),
8485
CreateSelectMenuOption::new(tr(ctx, "subtitle"), "subtitle")
8586
.description(tr(ctx, "subtitle-description")),
86-
].into(),
87+
]
88+
.into(),
8789
},
8890
)
8991
.placeholder(match state.next.kind {
@@ -116,7 +118,8 @@ pub fn create_components<'c>(
116118
CreateSelectMenuOption::new(tr(ctx, "red"), "RED"),
117119
CreateSelectMenuOption::new(tr(ctx, "white"), "WHITE"),
118120
CreateSelectMenuOption::new(tr(ctx, "yellow"), "YELLOW"),
119-
].into(),
121+
]
122+
.into(),
120123
},
121124
)
122125
.placeholder(match state.next.colour {
@@ -493,7 +496,9 @@ pub async fn modal_handler(
493496
id.state.shapes.push(builder::Shape {
494497
location: *location,
495498
colour: *colour,
496-
data: ShapeData::Subtitle { text: subtitle.to_string() },
499+
data: ShapeData::Subtitle {
500+
text: subtitle.to_string(),
501+
},
497502
});
498503
}
499504
(

crates/statpixel/src/commands/guild/image.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,9 +273,12 @@ pub async fn general(
273273
guild: &Guild,
274274
background: Option<Color>,
275275
) -> Result<Cow<'static, [u8]>, Error> {
276-
let guilds =
277-
get_snapshots_multiple_of_weekday(ctx, guild, Utc::now() - chrono::Duration::try_days(30).unwrap())
278-
.await?;
276+
let guilds = get_snapshots_multiple_of_weekday(
277+
ctx,
278+
guild,
279+
Utc::now() - chrono::Duration::try_days(30).unwrap(),
280+
)
281+
.await?;
279282
let monthly_xp = get_monthly_xp(guild, &guilds);
280283

281284
let members = futures::stream::iter(
@@ -451,9 +454,12 @@ pub async fn member(
451454
player: &Player,
452455
background: Option<Color>,
453456
) -> Result<Cow<'static, [u8]>, Error> {
454-
let guilds =
455-
get_snapshots_multiple_of_weekday(ctx, guild, Utc::now() - chrono::Duration::try_days(30).unwrap())
456-
.await?;
457+
let guilds = get_snapshots_multiple_of_weekday(
458+
ctx,
459+
guild,
460+
Utc::now() - chrono::Duration::try_days(30).unwrap(),
461+
)
462+
.await?;
457463

458464
let member_xp = get_member_monthly_xp(guild, &guilds);
459465
let member = player.get_display_string(ctx).await?;

crates/statpixel/src/commands/guild/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,9 @@ async fn top(
201201
name,
202202
player,
203203
uuid,
204-
days.map_or(chrono::Duration::try_days(30).unwrap(), |d| chrono::Duration::try_days(d).unwrap()),
204+
days.map_or(chrono::Duration::try_days(30).unwrap(), |d| {
205+
chrono::Duration::try_days(d).unwrap()
206+
}),
205207
limit,
206208
None,
207209
)

crates/statpixel/src/commands/skyblock/image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -812,7 +812,7 @@ pub async fn networth(
812812
let default = (&Category::default(), vec![]);
813813

814814
for i in categories.chunks(2) {
815-
let (left, left_items) = i.get(0).unwrap();
815+
let (left, left_items) = i.first().unwrap();
816816
let (right, right_items) = i.get(1).unwrap_or(&default);
817817

818818
let rows = left_items.len().max(right_items.len());

0 commit comments

Comments
 (0)