Skip to content

Commit 130926a

Browse files
committed
Bump clippy to 1.84.0, fix respective lints
1 parent fbc5a58 commit 130926a

11 files changed

Lines changed: 17 additions & 16 deletions

File tree

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.80.0"
1+
msrv = "1.84.0"

crates/buffered_watch/src/receiver.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl<T> Receiver<T> {
2121
}
2222

2323
/// Borrows the latest value
24-
pub fn borrow(&mut self) -> ReceiverGuard<T> {
24+
pub fn borrow(&'_ mut self) -> ReceiverGuard<'_, T> {
2525
let shared = self.shared.read();
2626
let index = {
2727
let states = &mut *shared.states.lock();
@@ -38,7 +38,7 @@ impl<T> Receiver<T> {
3838
}
3939

4040
/// Borrows the latest value and marks the buffer as seen
41-
pub fn borrow_and_mark_as_seen(&mut self) -> ReceiverGuard<T> {
41+
pub fn borrow_and_mark_as_seen(&'_ mut self) -> ReceiverGuard<'_, T> {
4242
let shared = self.shared.read();
4343
let index = {
4444
let states = &mut *shared.states.lock();

crates/buffered_watch/src/sender.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ unsafe impl<T> Send for Sender<T> where T: Send + Sync {}
2121

2222
impl<T> Sender<T> {
2323
/// Borrows the latest value
24-
pub fn borrow(&mut self) -> ReceiverGuard<T> {
24+
pub fn borrow(&'_ mut self) -> ReceiverGuard<'_, T> {
2525
let shared = self.shared.read();
2626
let index = {
2727
let states = &mut *shared.states.lock();
@@ -38,7 +38,7 @@ impl<T> Sender<T> {
3838
}
3939

4040
/// Borrows a buffer to write to
41-
pub fn borrow_mut(&mut self) -> SenderGuard<T> {
41+
pub fn borrow_mut(&'_ mut self) -> SenderGuard<'_, T> {
4242
let shared = self.shared.read();
4343
let index = {
4444
let states = &mut *shared.states.lock();

crates/control/src/free_kick_signal_filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ impl FreeKickSignalFilter {
172172
time: context.cycle_time.start_time,
173173
detected_kicking_team: own_detected_kicking_team,
174174
});
175-
if self.last_time_message_sent.as_ref().map_or(true, |time| {
175+
if self.last_time_message_sent.as_ref().is_none_or(|time| {
176176
now.duration_since(*time).expect("Time ran backwards") >= *context.message_interval
177177
}) && context.remaining_amount_of_messages.is_some_and(
178178
|remaining_amount_of_messages| {

crates/control/src/localization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ impl Localization {
249249
self.hypotheses
250250
.clone_from(&self.hypotheses_when_entered_playing);
251251
}
252-
} else if self.time_when_penalized_clicked.map_or(true, |time| {
252+
} else if self.time_when_penalized_clicked.is_none_or(|time| {
253253
context
254254
.cycle_time
255255
.start_time

crates/control/src/ready_signal_detection_filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl ReadySignalDetectionFilter {
155155
let now = context.cycle_time.start_time;
156156
self.detection_times[*context.player_number] = Some(now);
157157

158-
if self.last_time_message_sent.as_ref().map_or(true, |time| {
158+
if self.last_time_message_sent.as_ref().is_none_or(|time| {
159159
now.duration_since(*time).expect("Time ran backwards") >= *context.message_interval
160160
}) && context.remaining_amount_of_messages.is_some_and(
161161
|remaining_amount_of_messages| {

crates/framework/src/perception_databases.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ where
3838
self.first_timestamp_of_temporary_databases
3939
}
4040

41-
pub fn persistent(&self) -> Range<SystemTime, Databases> {
41+
pub fn persistent(&'_ self) -> Range<'_, SystemTime, Databases> {
4242
if let Some(first_timestamp_of_temporary_databases) =
4343
self.first_timestamp_of_temporary_databases
4444
{
@@ -49,7 +49,7 @@ where
4949
}
5050
}
5151

52-
pub fn temporary(&self) -> Range<SystemTime, Databases> {
52+
pub fn temporary(&'_ self) -> Range<'_, SystemTime, Databases> {
5353
if let Some(first_timestamp_of_temporary_databases) =
5454
self.first_timestamp_of_temporary_databases
5555
{

crates/hulk_replayer/src/ticks.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ impl<'state> Ticks<'state> {
181181
absolute_time_to_time_string(current.map_to_absolute_time(self.frame_range));
182182
let galley = painter.layout_no_wrap(text.clone(), font.clone(), color_strong);
183183
let text_position = pos2(x.inner() - galley.rect.width() / 2.0, clip_rect.top());
184-
if position_text_rect.map_or(true, |position_text_rect| {
184+
if position_text_rect.is_none_or(|position_text_rect| {
185185
!galley
186186
.rect
187187
.translate(text_position.to_vec2())

crates/nao_camera/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ version.workspace = true
44
edition.workspace = true
55
license.workspace = true
66
homepage.workspace = true
7-
rust-version = "1.80"
87

98
[dependencies]
109
i2cdev = { workspace = true }

crates/types/src/limb.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ pub fn project_onto_limbs(position: Point2<Pixel>, projected_limbs: &[Limb]) ->
4343
}
4444

4545
pub fn is_above_limbs(position: Point2<Pixel>, projected_limbs: &[Limb]) -> bool {
46-
project_onto_limbs(position, projected_limbs).map_or(true, |projected_position_y| {
47-
position.y() < projected_position_y
48-
})
46+
project_onto_limbs(position, projected_limbs)
47+
.is_none_or(|projected_position_y| position.y() < projected_position_y)
4948
}
5049

5150
#[derive(

0 commit comments

Comments
 (0)