Skip to content
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
8 changes: 5 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ jobs:
uses: actions/checkout@v5

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.99
with:
components: clippy
# A pinned toolchain installs only what is listed here; @stable
# used to borrow rustfmt from the runner's preinstalled Rust.
components: clippy, rustfmt

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand Down Expand Up @@ -94,7 +96,7 @@ jobs:
uses: actions/checkout@v5

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.99

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-signing-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
fi

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.99

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
uses: actions/checkout@v5

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.99

- name: Cache Rust dependencies
uses: Swatinem/rust-cache@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prepare-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
fi

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.99

- name: Install cargo-edit
uses: taiki-e/install-action@v2
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ jobs:
uses: actions/checkout@v5

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
uses: dtolnay/rust-toolchain@1.99
with:
# Release validation runs cargo fmt --check.
components: rustfmt

# Intentionally NOT caching Rust dependencies on the release workflow:
# release builds run once per tag and never benefit from a hot cache,
Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ resolver = "3"

[workspace.package]
edition = "2024"
rust-version = "1.99"
license = "MIT OR Apache-2.0"
version = "0.4.2"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ into the project.
## Development

See [DESIGN.md](./DESIGN.md) for the full architecture and design rules. To
build from source you need a recent stable Rust toolchain. The wxDragon GUI
build from source you need Rust 1.99 or newer. The wxDragon GUI
feature on Windows additionally needs the Visual Studio C++ build tools, an
LLVM `libclang.dll` discoverable through `LIBCLANG_PATH`, and Ninja on
`PATH`.
Expand Down
1 change: 1 addition & 0 deletions crates/rabbit-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "rabbit-cli"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions crates/rabbit-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "rabbit-core"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[dependencies]
Expand Down
1 change: 0 additions & 1 deletion crates/rabbit-core/src/artifact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,6 @@ fn invalid_file_url(input: &str) -> RabbitError {
#[cfg(test)]
mod tests {
use std::fs;
use std::io::{Read as _, Write as _};
use std::net::TcpListener;
use std::thread;
use std::time::Duration;
Expand Down
6 changes: 4 additions & 2 deletions crates/rabbit-core/src/reapack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,8 +534,10 @@ mod tests {
let written = fs::read(&ini_path).unwrap();
assert_eq!(&written[..2], &[0xFF, 0xFE], "UTF-16 LE BOM preserved");
let units: Vec<u16> = written[2..]
.chunks_exact(2)
.map(|pair| u16::from_le_bytes([pair[0], pair[1]]))
.as_chunks::<2>()
.0
.iter()
.map(|pair| u16::from_le_bytes(*pair))
.collect();
let decoded = String::from_utf16(&units).unwrap();
assert!(decoded.contains(&format!("remote1={}|{}|1|2", TEST_REPO_NAME, TEST_REPO_URL)));
Expand Down
8 changes: 3 additions & 5 deletions crates/rabbit-core/src/text_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,11 @@ fn decode_bytes(bytes: Vec<u8>) -> DecodedTextFile {
}

fn decode_utf16(bytes: &[u8], unit_from_bytes: fn([u8; 2]) -> u16) -> String {
let mut units: Vec<u16> = bytes
.chunks_exact(2)
.map(|pair| unit_from_bytes([pair[0], pair[1]]))
.collect();
let (pairs, rest) = bytes.as_chunks::<2>();
let mut units: Vec<u16> = pairs.iter().map(|pair| unit_from_bytes(*pair)).collect();
// A trailing odd byte means the file is malformed UTF-16; keep the byte
// as its own unit rather than silently dropping it.
if let Some(&last) = bytes.chunks_exact(2).remainder().first() {
if let Some(&last) = rest.first() {
units.push(u16::from(last));
}
String::from_utf16_lossy(&units)
Expand Down
1 change: 1 addition & 0 deletions crates/rabbit-platform/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "rabbit-platform"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[dependencies]
Expand Down
1 change: 1 addition & 0 deletions crates/rabbit-ui-wxdragon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "rabbit-ui-wxdragon"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true

[features]
Expand Down
Loading
Loading