Skip to content

Commit

Permalink
Bump MSRV to 1.64
Browse files Browse the repository at this point in the history
  • Loading branch information
kchibisov authored Mar 8, 2023
1 parent fb9695d commit b18295a
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 18 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
rust_version: ['1.60.0', stable, nightly]
rust_version: ['1.64.0', stable, nightly]
platform:
# Note: Make sure that we test all the `docs.rs` targets defined in Cargo.toml!
- { target: x86_64-pc-windows-msvc, os: windows-latest, }
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
shell: bash
if: >
!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

- name: Run tests
Expand All @@ -96,7 +96,7 @@ jobs:
!contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32') &&
!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

- name: Lint with clippy
Expand All @@ -108,7 +108,7 @@ jobs:
shell: bash
if: >
!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
- name: Run tests with serde enabled
shell: bash
Expand All @@ -117,5 +117,5 @@ jobs:
!contains(matrix.platform.target, 'ios') &&
!contains(matrix.platform.target, 'wasm32') &&
!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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ And please only add new entries to the top of this list, right below the `# Unre

# Unreleased

- Bump MSRV from `1.60` to `1.64`.

# 0.28.2

- Implement `HasRawDisplayHandle` for `EventLoop`.
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

- 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
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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ readme = "README.md"
repository = "https://github.com/rust-windowing/winit"
documentation = "https://docs.rs/winit"
categories = ["gui"]
rust-version = "1.60.0"
rust-version = "1.64.0"

[package.metadata.docs.rs]
features = ["serde"]
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/linux/wayland/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl MonitorHandle {
sctk::output::with_output_info(&self.proxy, |info| {
info.modes
.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()
}
Expand Down
4 changes: 2 additions & 2 deletions src/platform_impl/linux/wayland/seat/text_input/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ pub(super) fn handle_text_input(
let text = text.unwrap_or_default();
let cursor_begin = usize::try_from(cursor_begin)
.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)
.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 {
text,
Expand Down
6 changes: 3 additions & 3 deletions src/platform_impl/linux/x11/ime/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ impl ImeContext {
ptr::null_mut::<()>(),
);

(!ic.is_null()).then(|| ic)
(!ic.is_null()).then_some(ic)
}

unsafe fn create_preedit_ic(
Expand Down Expand Up @@ -302,7 +302,7 @@ impl ImeContext {
ptr::null_mut::<()>(),
);

(!ic.is_null()).then(|| ic)
(!ic.is_null()).then_some(ic)
}

unsafe fn create_nothing_ic(
Expand All @@ -320,7 +320,7 @@ impl ImeContext {
ptr::null_mut::<()>(),
);

(!ic.is_null()).then(|| ic)
(!ic.is_null()).then_some(ic)
}

pub(crate) fn focus(&self, xconn: &Arc<XConnection>) -> Result<(), XError> {
Expand Down
2 changes: 1 addition & 1 deletion src/platform_impl/linux/x11/util/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl<'a> NormalHints<'a> {
}

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.height_inc as u32,
Expand Down
9 changes: 5 additions & 4 deletions src/platform_impl/windows/window_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,10 +371,11 @@ impl WindowFlags {

if diff.contains(WindowFlags::CLOSABLE) || new.contains(WindowFlags::CLOSABLE) {
let flags = MF_BYCOMMAND
| new
.contains(WindowFlags::CLOSABLE)
.then(|| MF_ENABLED)
.unwrap_or(MF_DISABLED);
| if new.contains(WindowFlags::CLOSABLE) {
MF_ENABLED
} else {
MF_DISABLED
};

unsafe {
EnableMenuItem(GetSystemMenu(window, 0), SC_CLOSE, flags);
Expand Down

0 comments on commit b18295a

Please sign in to comment.