Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
msrv = "1.80.0"
msrv = "1.84.0"
4 changes: 2 additions & 2 deletions crates/buffered_watch/src/receiver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ impl<T> Receiver<T> {
}

/// Borrows the latest value
pub fn borrow(&mut self) -> ReceiverGuard<T> {
pub fn borrow(&'_ mut self) -> ReceiverGuard<'_, T> {
Comment thread
rmburg marked this conversation as resolved.
let shared = self.shared.read();
let index = {
let states = &mut *shared.states.lock();
Expand All @@ -38,7 +38,7 @@ impl<T> Receiver<T> {
}

/// Borrows the latest value and marks the buffer as seen
pub fn borrow_and_mark_as_seen(&mut self) -> ReceiverGuard<T> {
pub fn borrow_and_mark_as_seen(&'_ mut self) -> ReceiverGuard<'_, T> {
let shared = self.shared.read();
let index = {
let states = &mut *shared.states.lock();
Expand Down
4 changes: 2 additions & 2 deletions crates/buffered_watch/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ unsafe impl<T> Send for Sender<T> where T: Send + Sync {}

impl<T> Sender<T> {
/// Borrows the latest value
pub fn borrow(&mut self) -> ReceiverGuard<T> {
pub fn borrow(&'_ mut self) -> ReceiverGuard<'_, T> {
let shared = self.shared.read();
let index = {
let states = &mut *shared.states.lock();
Expand All @@ -38,7 +38,7 @@ impl<T> Sender<T> {
}

/// Borrows a buffer to write to
pub fn borrow_mut(&mut self) -> SenderGuard<T> {
pub fn borrow_mut(&'_ mut self) -> SenderGuard<'_, T> {
let shared = self.shared.read();
let index = {
let states = &mut *shared.states.lock();
Expand Down
2 changes: 1 addition & 1 deletion crates/control/src/free_kick_signal_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ impl FreeKickSignalFilter {
time: context.cycle_time.start_time,
detected_kicking_team: own_detected_kicking_team,
});
if self.last_time_message_sent.as_ref().map_or(true, |time| {
if self.last_time_message_sent.as_ref().is_none_or(|time| {
now.duration_since(*time).expect("Time ran backwards") >= *context.message_interval
}) && context.remaining_amount_of_messages.is_some_and(
|remaining_amount_of_messages| {
Expand Down
2 changes: 1 addition & 1 deletion crates/control/src/localization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl Localization {
self.hypotheses
.clone_from(&self.hypotheses_when_entered_playing);
}
} else if self.time_when_penalized_clicked.map_or(true, |time| {
} else if self.time_when_penalized_clicked.is_none_or(|time| {
context
.cycle_time
.start_time
Expand Down
2 changes: 1 addition & 1 deletion crates/control/src/ready_signal_detection_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl ReadySignalDetectionFilter {
let now = context.cycle_time.start_time;
self.detection_times[*context.player_number] = Some(now);

if self.last_time_message_sent.as_ref().map_or(true, |time| {
if self.last_time_message_sent.as_ref().is_none_or(|time| {
now.duration_since(*time).expect("Time ran backwards") >= *context.message_interval
}) && context.remaining_amount_of_messages.is_some_and(
|remaining_amount_of_messages| {
Expand Down
4 changes: 2 additions & 2 deletions crates/framework/src/perception_databases.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ where
self.first_timestamp_of_temporary_databases
}

pub fn persistent(&self) -> Range<SystemTime, Databases> {
pub fn persistent(&'_ self) -> Range<'_, SystemTime, Databases> {
if let Some(first_timestamp_of_temporary_databases) =
self.first_timestamp_of_temporary_databases
{
Expand All @@ -49,7 +49,7 @@ where
}
}

pub fn temporary(&self) -> Range<SystemTime, Databases> {
pub fn temporary(&'_ self) -> Range<'_, SystemTime, Databases> {
if let Some(first_timestamp_of_temporary_databases) =
self.first_timestamp_of_temporary_databases
{
Expand Down
2 changes: 1 addition & 1 deletion crates/hulk_replayer/src/ticks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ impl<'state> Ticks<'state> {
absolute_time_to_time_string(current.map_to_absolute_time(self.frame_range));
let galley = painter.layout_no_wrap(text.clone(), font.clone(), color_strong);
let text_position = pos2(x.inner() - galley.rect.width() / 2.0, clip_rect.top());
if position_text_rect.map_or(true, |position_text_rect| {
if position_text_rect.is_none_or(|position_text_rect| {
!galley
.rect
.translate(text_position.to_vec2())
Expand Down
1 change: 0 additions & 1 deletion crates/nao_camera/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ version.workspace = true
edition.workspace = true
license.workspace = true
homepage.workspace = true
rust-version = "1.80"

[dependencies]
i2cdev = { workspace = true }
Expand Down
5 changes: 2 additions & 3 deletions crates/types/src/limb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ pub fn project_onto_limbs(position: Point2<Pixel>, projected_limbs: &[Limb]) ->
}

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

#[derive(
Expand Down
5 changes: 4 additions & 1 deletion crates/vision/src/ball_detection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ fn merge_balls(balls: &[&CandidateEvaluation]) -> Circle<Pixel> {
circle
}

fn cluster_balls(balls: &[CandidateEvaluation], merge_radius_factor: f32) -> Vec<BallCluster> {
fn cluster_balls(
balls: &'_ [CandidateEvaluation],
merge_radius_factor: f32,
) -> Vec<BallCluster<'_>> {
let mut clusters = Vec::<BallCluster>::new();

for ball in balls {
Expand Down
Loading