Bump MSRV to 1.64

This commit is contained in:
Kirill Chibisov 2023-03-08 19:34:10 +03:00 committed by GitHub
parent fb9695d56d
commit b18295a1ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 21 additions and 18 deletions

View file

@ -22,7 +22,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
rust_version: ['1.60.0', stable, nightly] rust_version: ['1.64.0', stable, nightly]
platform: platform:
# Note: Make sure that we test all the `docs.rs` targets defined in Cargo.toml! # Note: Make sure that we test all the `docs.rs` targets defined in Cargo.toml!
- { target: x86_64-pc-windows-msvc, os: windows-latest, } - { target: x86_64-pc-windows-msvc, os: windows-latest, }
@ -86,7 +86,7 @@ jobs:
shell: bash shell: bash
if: > if: >
!contains(matrix.platform.target, 'redox') && !contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.60.0' matrix.rust_version != '1.64.0'
run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
- name: Run tests - name: Run tests
@ -96,7 +96,7 @@ jobs:
!contains(matrix.platform.target, 'ios') && !contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32') && !contains(matrix.platform.target, 'wasm32') &&
!contains(matrix.platform.target, 'redox') && !contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.60.0' matrix.rust_version != '1.64.0'
run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES
- name: Lint with clippy - name: Lint with clippy
@ -108,7 +108,7 @@ jobs:
shell: bash shell: bash
if: > if: >
!contains(matrix.platform.target, 'redox') && !contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.60.0' matrix.rust_version != '1.64.0'
run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES
- name: Run tests with serde enabled - name: Run tests with serde enabled
shell: bash shell: bash
@ -117,5 +117,5 @@ jobs:
!contains(matrix.platform.target, 'ios') && !contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32') && !contains(matrix.platform.target, 'wasm32') &&
!contains(matrix.platform.target, 'redox') && !contains(matrix.platform.target, 'redox') &&
matrix.rust_version != '1.60.0' matrix.rust_version != '1.64.0'
run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features serde,$FEATURES

View file

@ -8,6 +8,8 @@ And please only add new entries to the top of this list, right below the `# Unre
# Unreleased # Unreleased
- Bump MSRV from `1.60` to `1.64`.
# 0.28.2 # 0.28.2
- Implement `HasRawDisplayHandle` for `EventLoop`. - Implement `HasRawDisplayHandle` for `EventLoop`.

View file

@ -20,7 +20,7 @@ your description of the issue as detailed as possible:
When making a code contribution to winit, before opening your pull request, please make sure that: When making a code contribution to winit, before opening your pull request, please make sure that:
- your patch builds with Winit's minimal supported rust version - Rust 1.60. - your patch builds with Winit's minimal supported rust version - Rust 1.64.
- you tested your modifications on all the platforms impacted, or if not possible detail which platforms - you tested your modifications on all the platforms impacted, or if not possible detail which platforms
were not tested, and what should be tested, so that a maintainer or another contributor can test them were not tested, and what should be tested, so that a maintainer or another contributor can test them
- you updated any relevant documentation in winit - you updated any relevant documentation in winit

View file

@ -10,7 +10,7 @@ readme = "README.md"
repository = "https://github.com/rust-windowing/winit" repository = "https://github.com/rust-windowing/winit"
documentation = "https://docs.rs/winit" documentation = "https://docs.rs/winit"
categories = ["gui"] categories = ["gui"]
rust-version = "1.60.0" rust-version = "1.64.0"
[package.metadata.docs.rs] [package.metadata.docs.rs]
features = ["serde"] features = ["serde"]

View file

@ -171,7 +171,7 @@ impl MonitorHandle {
sctk::output::with_output_info(&self.proxy, |info| { sctk::output::with_output_info(&self.proxy, |info| {
info.modes info.modes
.iter() .iter()
.find_map(|mode| mode.is_current.then(|| mode.refresh_rate as u32)) .find_map(|mode| mode.is_current.then_some(mode.refresh_rate as u32))
}) })
.flatten() .flatten()
} }

View file

@ -72,10 +72,10 @@ pub(super) fn handle_text_input(
let text = text.unwrap_or_default(); let text = text.unwrap_or_default();
let cursor_begin = usize::try_from(cursor_begin) let cursor_begin = usize::try_from(cursor_begin)
.ok() .ok()
.and_then(|idx| text.is_char_boundary(idx).then(|| idx)); .and_then(|idx| text.is_char_boundary(idx).then_some(idx));
let cursor_end = usize::try_from(cursor_end) let cursor_end = usize::try_from(cursor_end)
.ok() .ok()
.and_then(|idx| text.is_char_boundary(idx).then(|| idx)); .and_then(|idx| text.is_char_boundary(idx).then_some(idx));
inner.pending_preedit = Some(Preedit { inner.pending_preedit = Some(Preedit {
text, text,

View file

@ -263,7 +263,7 @@ impl ImeContext {
ptr::null_mut::<()>(), ptr::null_mut::<()>(),
); );
(!ic.is_null()).then(|| ic) (!ic.is_null()).then_some(ic)
} }
unsafe fn create_preedit_ic( unsafe fn create_preedit_ic(
@ -302,7 +302,7 @@ impl ImeContext {
ptr::null_mut::<()>(), ptr::null_mut::<()>(),
); );
(!ic.is_null()).then(|| ic) (!ic.is_null()).then_some(ic)
} }
unsafe fn create_nothing_ic( unsafe fn create_nothing_ic(
@ -320,7 +320,7 @@ impl ImeContext {
ptr::null_mut::<()>(), ptr::null_mut::<()>(),
); );
(!ic.is_null()).then(|| ic) (!ic.is_null()).then_some(ic)
} }
pub(crate) fn focus(&self, xconn: &Arc<XConnection>) -> Result<(), XError> { pub(crate) fn focus(&self, xconn: &Arc<XConnection>) -> Result<(), XError> {

View file

@ -197,7 +197,7 @@ impl<'a> NormalHints<'a> {
} }
pub fn get_resize_increments(&self) -> Option<(u32, u32)> { pub fn get_resize_increments(&self) -> Option<(u32, u32)> {
has_flag(self.size_hints.flags, ffi::PResizeInc).then(|| { has_flag(self.size_hints.flags, ffi::PResizeInc).then_some({
( (
self.size_hints.width_inc as u32, self.size_hints.width_inc as u32,
self.size_hints.height_inc as u32, self.size_hints.height_inc as u32,

View file

@ -371,10 +371,11 @@ impl WindowFlags {
if diff.contains(WindowFlags::CLOSABLE) || new.contains(WindowFlags::CLOSABLE) { if diff.contains(WindowFlags::CLOSABLE) || new.contains(WindowFlags::CLOSABLE) {
let flags = MF_BYCOMMAND let flags = MF_BYCOMMAND
| new | if new.contains(WindowFlags::CLOSABLE) {
.contains(WindowFlags::CLOSABLE) MF_ENABLED
.then(|| MF_ENABLED) } else {
.unwrap_or(MF_DISABLED); MF_DISABLED
};
unsafe { unsafe {
EnableMenuItem(GetSystemMenu(window, 0), SC_CLOSE, flags); EnableMenuItem(GetSystemMenu(window, 0), SC_CLOSE, flags);