Set MSRV to 1.71

This commit is contained in:
Jeremy Soller 2024-01-29 09:43:06 -07:00
parent 213ede371b
commit 1291a48d4d
No known key found for this signature in database
GPG key ID: D02FD439211AF56F
4 changed files with 45 additions and 40 deletions

View file

@ -2,6 +2,7 @@
name = "libcosmic"
version = "0.1.0"
edition = "2021"
rust-version = "1.71"
[lib]
name = "cosmic"

View file

@ -45,11 +45,11 @@ where
}
#[allow(clippy::cast_precision_loss)]
fn variant_button_bounds(
&self,
state: &LocalState,
fn variant_button_bounds<'b>(
&'b self,
state: &'b LocalState,
mut bounds: Rectangle,
) -> impl Iterator<Item = (Entity, Rectangle)> {
) -> Box<dyn Iterator<Item = (Entity, Rectangle)> + 'b> {
let num = state.buttons_visible;
let spacing = f32::from(self.spacing);
let mut homogenous_width = 0.0;
@ -66,6 +66,7 @@ where
/ num as f32;
}
Box::new(
self.model
.order
.iter()
@ -84,7 +85,8 @@ where
bounds.x += this_bounds.width + spacing;
(key, this_bounds)
})
}),
)
}
#[allow(clippy::cast_precision_loss)]

View file

@ -45,13 +45,14 @@ where
}
#[allow(clippy::cast_precision_loss)]
fn variant_button_bounds(
&self,
state: &LocalState,
fn variant_button_bounds<'b>(
&'b self,
state: &'b LocalState,
mut bounds: Rectangle,
) -> impl Iterator<Item = (Entity, Rectangle)> {
) -> Box<dyn Iterator<Item = (Entity, Rectangle)> + 'b> {
let spacing = f32::from(self.spacing);
Box::new(
self.model
.order
.iter()
@ -62,7 +63,8 @@ where
this_bounds.height = state.internal_layout[0].height;
bounds.y += this_bounds.height + spacing;
(key, this_bounds)
})
}),
)
}
#[allow(clippy::cast_precision_loss)]

View file

@ -33,11 +33,11 @@ pub trait SegmentedVariant {
) -> super::Appearance;
/// Calculates the bounds for visible buttons.
fn variant_button_bounds(
&self,
state: &LocalState,
fn variant_button_bounds<'b>(
&'b self,
state: &'b LocalState,
bounds: Rectangle,
) -> impl Iterator<Item = (Entity, Rectangle)>;
) -> Box<dyn Iterator<Item = (Entity, Rectangle)> + 'b>;
/// Calculates the layout of this variant.
fn variant_layout(