From 2a6b601ecc637efbe5df08facddf19b75eb89b68 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Tue, 13 Aug 2024 16:43:58 +0200 Subject: [PATCH 1/4] Fix nit with pattern splitting --- .gitignore | 1 + ctru-sys/build.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index f4d733bf..13756ef6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Cargo.lock # IDE files .idea .vscode +.zed diff --git a/ctru-sys/build.rs b/ctru-sys/build.rs index 5b1fe3c0..abf7ad00 100644 --- a/ctru-sys/build.rs +++ b/ctru-sys/build.rs @@ -239,7 +239,7 @@ fn get_libctru_version(pacman: &Path) -> Result<(String, String, String, String) fn parse_libctru_version(version: &str) -> Result<(String, String, String, String), String> { version - .split(|c| c == '.' || c == '-') + .split(['.', '-']) .map(String::from) .collect_tuple() .ok_or_else(|| format!("unexpected number of version segments: {version:?}")) From 2ec9a40bc8896adb4df5bca8dd6a96368f06bec2 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 14 Aug 2024 16:07:46 +0200 Subject: [PATCH 2/4] MSRV bump to 1.78 and slight warning cleanup --- .github/workflows/ci.yml | 4 ++-- ctru-rs/Cargo.toml | 7 +++---- ctru-rs/src/console.rs | 2 +- ctru-rs/src/lib.rs | 1 - ctru-sys/src/lib.rs | 1 + 5 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 32aa7156..8dacb15f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: matrix: toolchain: # Run against a "known good" nightly. Rustc version is 1 day behind the toolchain date - - nightly-2024-02-18 + - nightly-2024-03-16 # Check for breakage on latest nightly - nightly @@ -54,7 +54,7 @@ jobs: strategy: matrix: toolchain: - - nightly-2024-02-18 + - nightly-2024-03-16 - nightly continue-on-error: ${{ matrix.toolchain == 'nightly' }} runs-on: ubuntu-latest diff --git a/ctru-rs/Cargo.toml b/ctru-rs/Cargo.toml index c1e22930..9cbc629c 100644 --- a/ctru-rs/Cargo.toml +++ b/ctru-rs/Cargo.toml @@ -10,7 +10,7 @@ categories = ["os", "api-bindings", "hardware-support"] exclude = ["examples"] license = "Zlib" edition = "2021" -rust-version = "1.73" +rust-version = "1.78" [lib] crate-type = ["rlib"] @@ -19,13 +19,12 @@ name = "ctru" [dependencies] cfg-if = "1.0" ctru-sys = { path = "../ctru-sys", version = "0.5.0" } -const-zero = "0.1.0" shim-3ds = { workspace = true } pthread-3ds = { workspace = true } libc = { workspace = true, default-features = true } -bitflags = "2.3.3" +bitflags = "2.6.0" macaddr = "1.0.1" -widestring = "1.0.2" +widestring = "1.1.0" [build-dependencies] toml = "0.5" diff --git a/ctru-rs/src/console.rs b/ctru-rs/src/console.rs index 02702ccb..7605883c 100644 --- a/ctru-rs/src/console.rs +++ b/ctru-rs/src/console.rs @@ -11,7 +11,7 @@ use ctru_sys::{consoleClear, consoleInit, consoleSelect, consoleSetWindow, Print use crate::services::gfx::{Flush, Screen, Swap}; -static mut EMPTY_CONSOLE: PrintConsole = unsafe { const_zero::const_zero!(PrintConsole) }; +static mut EMPTY_CONSOLE: PrintConsole = unsafe { std::mem::zeroed::() }; /// Error enum for generic errors within [`Console`]. #[derive(Copy, Clone, Debug, PartialEq, Eq)] diff --git a/ctru-rs/src/lib.rs b/ctru-rs/src/lib.rs index 09da6a18..80008586 100644 --- a/ctru-rs/src/lib.rs +++ b/ctru-rs/src/lib.rs @@ -23,7 +23,6 @@ #![feature(try_trait_v2)] #![feature(allocator_api)] #![feature(new_uninit)] -#![feature(diagnostic_namespace)] #![test_runner(test_runner::run_gdb)] // TODO: does this make sense to have configurable? #![doc( html_favicon_url = "https://user-images.githubusercontent.com/11131775/225929072-2fa1741c-93ae-4b47-9bdf-af70f3d59910.png" diff --git a/ctru-sys/src/lib.rs b/ctru-sys/src/lib.rs index 4e8e82f3..da313df7 100644 --- a/ctru-sys/src/lib.rs +++ b/ctru-sys/src/lib.rs @@ -3,6 +3,7 @@ #![allow(non_camel_case_types)] #![allow(non_snake_case)] #![allow(clippy::all)] +#![allow(unexpected_cfgs)] // Read below why we necessate a check for rust_analyzer. #![deny(ambiguous_glob_reexports)] #![cfg_attr(test, feature(custom_test_frameworks))] #![cfg_attr(test, test_runner(test_runner::run_gdb))] From a71c0c1809e348045cb0760c16b9cfe515915ba5 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 15 Aug 2024 15:22:29 +0200 Subject: [PATCH 3/4] Fix clippy lint in local-networking example --- ctru-rs/examples/local-networking.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctru-rs/examples/local-networking.rs b/ctru-rs/examples/local-networking.rs index 10467d51..19e58cd2 100644 --- a/ctru-rs/examples/local-networking.rs +++ b/ctru-rs/examples/local-networking.rs @@ -60,8 +60,8 @@ fn main() -> Result<(), Error> { let mut mode = ConnectionType::Client; - let mut channel = 0; - let data_channel = 1; + let mut channel: u8; + let data_channel: u8 = 1; let mut prev_node_mask = 0; From 98c46dfe7b99469f7887fbd83048eb52418ebf56 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Thu, 15 Aug 2024 15:46:04 +0200 Subject: [PATCH 4/4] Use older nightly for testing --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dacb15f..49cc0cc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ jobs: matrix: toolchain: # Run against a "known good" nightly. Rustc version is 1 day behind the toolchain date - - nightly-2024-03-16 + - nightly-2024-03-10 # Check for breakage on latest nightly - nightly @@ -54,7 +54,7 @@ jobs: strategy: matrix: toolchain: - - nightly-2024-03-16 + - nightly-2024-03-10 - nightly continue-on-error: ${{ matrix.toolchain == 'nightly' }} runs-on: ubuntu-latest