Skip to content

Commit

Permalink
Bump rust requirement to 1.81, utilize lint_expect
Browse files Browse the repository at this point in the history
  • Loading branch information
crumblingstatue committed Sep 5, 2024
1 parent 6d1a2df commit 48e4ccd
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: hecrj/setup-rust-action@v1
with:
rust-version: 1.70.0
rust-version: 1.81.0
- uses: actions/checkout@v2
- name: Install deps
run: |
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ license = "zlib-acknowledgement"
keywords = ["sfml", "multimedia", "game"]
readme = "README.md"
edition = "2021"
rust-version = "1.70"
rust-version = "1.81"

[features]
default = ["graphics", "audio"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Requirements
=============

- Linux, Windows, or OS X
- Rust 1.70 or later
- Rust 1.81 or later
- [SFML 2.6](http://www.sfml-dev.org/download.php)
- A C++ compiler for building CSFML

Expand Down
2 changes: 1 addition & 1 deletion src/ffi/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub(crate) struct SensorEvent {

#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
#[allow(dead_code)] // constructed on C++ side by SFML
#[expect(dead_code, reason = "constructed on C++ side by SFML")]
pub(crate) enum EventType {
Closed,
Resized,
Expand Down
3 changes: 1 addition & 2 deletions src/graphics/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ impl From<u32> for Color {
/// Construct the color from 32-bit unsigned integer.
///
/// The number should contain the components in RGBA order.
#[allow(clippy::cast_possible_truncation)]
fn from(src: u32) -> Self {
Self {
r: ((src & 0xff000000) >> 24) as u8,
Expand Down Expand Up @@ -160,7 +159,7 @@ impl Mul for Color {
/// Calculate the component-wise modulated multiplication of two colors.
///
/// For each `X` in `rgba`, `result.X = a.X * b.X / 255`.
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
fn mul(self, other: Color) -> Color {
let (r1, r2) = (self.r as u16, other.r as u16);
let (g1, g2) = (self.g as u16, other.g as u16);
Expand Down
1 change: 0 additions & 1 deletion src/graphics/convex_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub struct ConvexShape<'s> {

/// An iterator over the points of a [`ConvexShape`].
#[derive(Debug)]
#[allow(missing_copy_implementations)]
pub struct ConvexShapePoints {
convex_shape: *mut ffi::sfConvexShape,
pos: usize,
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Transform {
/// - *a20* : Element (2, 0) of the matrix
/// - *a21* : Element (2, 1) of the matrix
/// - *a22* : Element (2, 2) of the matrix
#[allow(clippy::too_many_arguments)]
#[expect(clippy::too_many_arguments)]
#[must_use]
pub fn new(
a00: f32,
Expand Down
2 changes: 1 addition & 1 deletion src/system/input_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use {
},
};

#[allow(clippy::comparison_chain)]
#[expect(clippy::comparison_chain)]
unsafe extern "C" fn read<T: Read + Seek>(
data: *mut c_void,
size: c_longlong,
Expand Down
4 changes: 2 additions & 2 deletions src/system/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl Ord for Time {
impl Time {
/// Constructs a time value from a number of seconds.
#[must_use]
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
pub fn seconds(seconds: f32) -> Self {
Time((seconds * 1000000.) as i64)
}
Expand All @@ -89,7 +89,7 @@ impl Time {

/// Returns the time value as a number of milliseconds.
#[must_use]
#[allow(clippy::cast_possible_truncation)]
#[expect(clippy::cast_possible_truncation)]
pub fn as_milliseconds(self) -> i32 {
(self.0 / 1000) as i32
}
Expand Down
2 changes: 1 addition & 1 deletion src/window/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ mod style;
pub(crate) mod thread_safety;
pub mod touch;
mod video_mode;
#[allow(clippy::module_inception)]
#[expect(clippy::module_inception)]
mod window;

0 comments on commit 48e4ccd

Please sign in to comment.