Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slight MSRV bump and lint fixing #192

Merged
merged 4 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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-10
# Check for breakage on latest nightly
- nightly

Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
matrix:
toolchain:
- nightly-2024-02-18
- nightly-2024-03-10
- nightly
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Cargo.lock
# IDE files
.idea
.vscode
.zed
7 changes: 3 additions & 4 deletions ctru-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions ctru-rs/examples/local-networking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion ctru-rs/src/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<PrintConsole>() };

/// Error enum for generic errors within [`Console`].
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
Expand Down
1 change: 0 additions & 1 deletion ctru-rs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion ctru-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}"))
Expand Down
1 change: 1 addition & 0 deletions ctru-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I probably would have advocated for adding rust_analyzer specifically as a known cfg something like

[lints.rust.unexpected_cfgs]
check-cfg = ['cfg(rust_analyzer)']

but not a big difference really.

I guess I'm surprised this isn't a well-known value but I guess it's rarer to set than many of those other ones

#![deny(ambiguous_glob_reexports)]
#![cfg_attr(test, feature(custom_test_frameworks))]
#![cfg_attr(test, test_runner(test_runner::run_gdb))]
Expand Down
Loading