diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e5f19b3..2e2b5aed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,7 +122,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] - toolchain: ["1.74.0", "stable"] + toolchain: ["1.85.0", "stable"] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -191,7 +191,7 @@ jobs: strategy: fail-fast: false matrix: - toolchain: ["1.74.0", "stable"] + toolchain: ["1.85.0", "stable"] steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable diff --git a/Cargo.toml b/Cargo.toml index e0ae1100..bde797cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ readme = "README.md" license = "MIT" exclude = ["assets/*", ".github", "Makefile.toml", "CONTRIBUTING.md", "*.log", "tags"] edition = "2021" -rust-version = "1.81.0" +rust-version = "1.85.0" [workspace.dependencies] anstyle = "1" diff --git a/examples/apps/canvas/src/main.rs b/examples/apps/canvas/src/main.rs index fb4405f7..a403aa68 100644 --- a/examples/apps/canvas/src/main.rs +++ b/examples/apps/canvas/src/main.rs @@ -117,7 +117,7 @@ impl App { } } - fn cycle_marker(&mut self) { + const fn cycle_marker(&mut self) { self.marker = match self.marker { Marker::Dot => Marker::Braille, Marker::Braille => Marker::Block, diff --git a/examples/apps/chart/src/main.rs b/examples/apps/chart/src/main.rs index e99ce205..2a358f68 100644 --- a/examples/apps/chart/src/main.rs +++ b/examples/apps/chart/src/main.rs @@ -128,7 +128,7 @@ impl App { format!("{}", self.window[0]), Style::default().add_modifier(Modifier::BOLD), ), - Span::raw(format!("{}", (self.window[0] + self.window[1]) / 2.0)), + Span::raw(format!("{}", f64::midpoint(self.window[0], self.window[1]))), Span::styled( format!("{}", self.window[1]), Style::default().add_modifier(Modifier::BOLD), diff --git a/examples/apps/scrollbar/src/main.rs b/examples/apps/scrollbar/src/main.rs index 8afd64c6..7c9d7571 100644 --- a/examples/apps/scrollbar/src/main.rs +++ b/examples/apps/scrollbar/src/main.rs @@ -60,24 +60,24 @@ impl App { } } - fn scroll_down(&mut self) { + const fn scroll_down(&mut self) { self.vertical_scroll = self.vertical_scroll.saturating_add(1); self.vertical_scroll_state = self.vertical_scroll_state.position(self.vertical_scroll); } - fn scroll_up(&mut self) { + const fn scroll_up(&mut self) { self.vertical_scroll = self.vertical_scroll.saturating_sub(1); self.vertical_scroll_state = self.vertical_scroll_state.position(self.vertical_scroll); } - fn scroll_left(&mut self) { + const fn scroll_left(&mut self) { self.horizontal_scroll = self.horizontal_scroll.saturating_sub(1); self.horizontal_scroll_state = self .horizontal_scroll_state .position(self.horizontal_scroll); } - fn scroll_right(&mut self) { + const fn scroll_right(&mut self) { self.horizontal_scroll = self.horizontal_scroll.saturating_add(1); self.horizontal_scroll_state = self .horizontal_scroll_state