1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-02 14:50:03 -04:00

Update MSRV from 1.92 to 1.95 (#8348)

No particular reason

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Emil Ernerfeldt
2026-07-28 01:37:03 -07:00
committed by GitHub
parent 8fc323fbcf
commit b730815797
47 changed files with 75 additions and 75 deletions

View File

@@ -122,13 +122,13 @@ impl<T: WinitApp> WinitAppWrapper<T> {
event_result
}
EventResult::RepaintNow(window_id) => {
log::trace!("RepaintNow of {window_id:?}",);
log::trace!("RepaintNow of {window_id:?}");
self.windows_next_repaint_times
.insert(window_id, Instant::now());
event_result
}
EventResult::RepaintNext(window_id) => {
log::trace!("RepaintNext of {window_id:?}",);
log::trace!("RepaintNext of {window_id:?}");
self.windows_next_repaint_times
.insert(window_id, Instant::now());
event_result

View File

@@ -3506,7 +3506,7 @@ impl Context {
if !is_visible {
continue;
}
let text = format!("{} - {:?}", layer_id.short_debug_format(), area.rect(),);
let text = format!("{} - {:?}", layer_id.short_debug_format(), area.rect());
// TODO(emilk): `Sense::hover_highlight()`
let response =
ui.add(Label::new(RichText::new(text).monospace()).sense(Sense::click()));

View File

@@ -201,8 +201,6 @@ fn contains_circle(interact_rect: emath::Rect, pos: Pos2, radius: f32) -> bool {
}
fn hit_test_on_close(close: &[WidgetRect], pos: Pos2) -> WidgetHits {
#![expect(clippy::collapsible_else_if)]
// First find the best direct hits:
let hit_click = find_closest_within(
close.iter().copied().filter(|w| w.sense.senses_click()),

View File

@@ -3,7 +3,7 @@
//! Try the live web demo: <https://www.egui.rs/#demo>. Read more about egui at <https://github.com/emilk/egui>.
//!
//! `egui` is in heavy development, with each new version having breaking changes.
//! You need to have rust 1.92.0 or later to use `egui`.
//! You need to have rust 1.95.0 or later to use `egui`.
//!
//! To quickly get started with egui, you can take a look at [`eframe_template`](https://github.com/emilk/eframe_template)
//! which uses [`eframe`](https://docs.rs/eframe).

View File

@@ -1460,9 +1460,9 @@ fn order_map_total_ordering() {
// Assert that `areas.compare_order()` forms a total ordering
let mut equivalence_classes = vec![0];
let mut i = 0;
for l in layers.windows(2) {
assert!(l[0].order <= l[1].order, "does not follow LayerId.order");
if areas.compare_order(l[0], l[1]) != std::cmp::Ordering::Equal {
for &[a, b] in layers.array_windows() {
assert!(a.order <= b.order, "does not follow LayerId.order");
if areas.compare_order(a, b) != std::cmp::Ordering::Equal {
i += 1;
}
equivalence_classes.push(i);

View File

@@ -134,9 +134,8 @@ where
if self.has_undo(current_state) {
self.flux = None;
if self.undos.back() == Some(current_state) {
#[expect(clippy::unwrap_used)] // we just checked that undos is not empty
self.redos.push(self.undos.pop_back().unwrap());
if let Some(state) = self.undos.pop_back_if(|state| &*state == current_state) {
self.redos.push(state);
} else {
self.redos.push(current_state.clone());
}

View File

@@ -160,16 +160,14 @@ where
while self.values.len() > self.max_len {
self.values.pop_front();
}
while self.values.len() > self.min_len {
if let Some((front_time, _)) = self.values.front() {
if *front_time < now - (self.max_age as f64) {
self.values.pop_front();
} else {
break;
}
} else {
break;
}
let oldest_allowed_time = now - self.max_age as f64;
while self.min_len < self.values.len()
&& self
.values
.pop_front_if(|&mut (front_time, _)| front_time < oldest_allowed_time)
.is_some()
{
// Keep popping while the oldest sample is too old.
}
}
}

View File

@@ -512,8 +512,7 @@ fn points_from_line(
shapes: &mut Vec<Shape>,
) {
let mut position_on_segment = 0.0;
for window in path.windows(2) {
let (start, end) = (window[0], window[1]);
for &[start, end] in path.array_windows() {
let vector = end - start;
let segment_length = vector.length();
while position_on_segment < segment_length {
@@ -545,8 +544,7 @@ fn dashes_from_line(
let mut drawing_dash = false;
let mut step = 0;
let steps = dash_lengths.len();
for window in path.windows(2) {
let (start, end) = (window[0], window[1]);
for &[start, end] in path.array_windows() {
let vector = end - start;
let segment_length = vector.length();

View File

@@ -117,7 +117,6 @@ impl SubpixelBin {
let trunc = pos as i32;
let fract = pos - trunc as f32;
#[expect(clippy::collapsible_else_if)]
if pos.is_sign_negative() {
if fract > -0.125 {
(trunc, Self::Zero)

View File

@@ -471,8 +471,7 @@ fn layout_section(
// Process each paragraph segment (split on newlines — the shaper can't handle them).
for (seg_idx, segment) in SplitOrWhole::new(section_text, job.break_on_newline).enumerate() {
if 0 < seg_idx {
out_paragraphs.push(Paragraph::from_section_index(section_index));
paragraph = out_paragraphs.last_mut().unwrap();
paragraph = out_paragraphs.push_mut(Paragraph::from_section_index(section_index));
paragraph.empty_paragraph_height = line_height;
ctx.is_first_glyph_in_section = true;
}
@@ -1864,7 +1863,7 @@ mod tests {
// Verify that Row::text() reconstructs the input text.
let row_text: String = galley.rows.iter().map(|r| r.text()).collect();
assert_eq!(row_text, text, "Row::text() mismatch for {text:?}",);
assert_eq!(row_text, text, "Row::text() mismatch for {text:?}");
// Verify cursor round-trip: end cursor index == char count.
assert_eq!(