diff --git a/.cargo/config.toml b/.cargo/config.toml index 085f3158..802a1c59 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,9 +1,16 @@ -# Windows has stack overflows when calling from Tauri, so we increase the default stack size used by the compiler -[target.'cfg(windows)'] -rustflags = ["-C", "link-args=/STACK:16777220", "--cfg", "tokio_unstable"] +# Enable Cranelift for debug builds, improving iterative compile times +[unstable] +codegen-backend = true -[target.x86_64-pc-windows-msvc] -linker = "rust-lld" +[profile.dev] +codegen-backend = "cranelift" [build] rustflags = ["--cfg", "tokio_unstable"] + +# Windows has stack overflows when calling from Tauri, so we increase the default stack size used by the compiler +[target.'cfg(windows)'] +rustflags = ["--cfg", "tokio_unstable", "-C", "link-args=/STACK:16777220"] + +[target.x86_64-pc-windows-msvc] +linker = "rust-lld" diff --git a/.github/workflows/turbo-ci.yml b/.github/workflows/turbo-ci.yml index 0616743f..e5140c2f 100644 --- a/.github/workflows/turbo-ci.yml +++ b/.github/workflows/turbo-ci.yml @@ -18,6 +18,11 @@ jobs: FORCE_COLOR: 3 # Make cargo nextest successfully ignore projects without tests NEXTEST_NO_TESTS: pass + # Fail on warnings in CI + # (but don't do this in the root `Cargo.toml`, + # since we don't want warnings to become errors + # while developing) + RUSTFLAGS: -Dwarnings steps: - name: 📥 Check out code diff --git a/Cargo.toml b/Cargo.toml index 5f0a461f..2c80cd5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -218,10 +218,6 @@ todo = "warn" unnested_or_patterns = "warn" wildcard_dependencies = "warn" -[workspace.lints.rust] -# Turn warnings into errors by default -warnings = "deny" - [patch.crates-io] wry = { git = "https://github.com/modrinth/wry", rev = "f2ce0b0" } diff --git a/apps/labrinth/src/database/models/version_item.rs b/apps/labrinth/src/database/models/version_item.rs index 0aae95b2..c97a43e5 100644 --- a/apps/labrinth/src/database/models/version_item.rs +++ b/apps/labrinth/src/database/models/version_item.rs @@ -1010,7 +1010,7 @@ mod tests { #[test] fn test_version_sorting() { - let versions = vec![ + let versions = [ get_version(4, None, months_ago(6)), get_version(3, None, months_ago(7)), get_version(2, Some(1), months_ago(6)), diff --git a/apps/labrinth/src/routes/v2/version_creation.rs b/apps/labrinth/src/routes/v2/version_creation.rs index 9406ce55..0c27f200 100644 --- a/apps/labrinth/src/routes/v2/version_creation.rs +++ b/apps/labrinth/src/routes/v2/version_creation.rs @@ -73,12 +73,6 @@ pub struct InitialVersionData { pub ordering: Option, } -#[derive(Serialize, Deserialize, Clone)] -struct InitialFileData { - #[serde(default = "HashMap::new")] - pub file_types: HashMap>, -} - // under `/api/v1/version` #[post("version")] pub async fn version_create( diff --git a/packages/app-lib/src/state/cache.rs b/packages/app-lib/src/state/cache.rs index 98f1bb79..91fb6a41 100644 --- a/packages/app-lib/src/state/cache.rs +++ b/packages/app-lib/src/state/cache.rs @@ -519,11 +519,14 @@ impl CacheValue { } } -#[derive(Deserialize, Serialize, PartialEq, Eq, Debug, Copy, Clone)] +#[derive( + Deserialize, Serialize, PartialEq, Eq, Debug, Copy, Clone, Default, +)] #[serde(rename_all = "snake_case")] pub enum CacheBehaviour { /// Serve expired data. If fetch fails / launcher is offline, errors are ignored /// and expired data is served + #[default] StaleWhileRevalidateSkipOffline, // Serve expired data, revalidate in background StaleWhileRevalidate, @@ -533,12 +536,6 @@ pub enum CacheBehaviour { Bypass, } -impl Default for CacheBehaviour { - fn default() -> Self { - Self::StaleWhileRevalidateSkipOffline - } -} - #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CachedEntry { id: String, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b67e7d53..a6e94890 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,9 @@ [toolchain] -channel = "1.89.0" +channel = "nightly-2025-09-18" +profile = "default" +components = [ + "rust-analyzer", + # use cranelift in debug builds to improve compile times + # also see `.cargo/config.toml` + "rustc-codegen-cranelift-preview" +]