Skip to content

Commit 4eb9fdb

Browse files
committed
update rust
1 parent 410811e commit 4eb9fdb

9 files changed

Lines changed: 21 additions & 31 deletions

File tree

osrs_py/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-03-01"
2+
channel = "nightly-2026-07-05"
33
components = [ "rustfmt", "clippy" ]
44
profile = "minimal"

rs3_py/rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-03-01"
2+
channel = "nightly-2026-07-05"
33
components = [ "rustfmt", "clippy" ]
44
profile = "minimal"

rs3cache_backend/src/index/dat2.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,7 @@ impl CacheIndex<Initial> {
159159
// Let's try looking somewhere else
160160
Err(_) => {
161161
let alt_path = path!(input / "keys.json");
162-
match Xtea::load(alt_path) {
163-
Ok(file) => Some(file),
164-
Err(e) => return Err(e),
165-
}
162+
Some(Xtea::load(alt_path)?)
166163
}
167164
}
168165
} else {

rs3cache_backend/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
//! Core cache interpreting utilities.
22
3-
#![feature(error_generic_member_access, error_iter, cfg_eval, try_blocks, array_chunks, if_let_guard, let_chains)]
3+
#![feature(error_generic_member_access)]
4+
#![feature(error_iter)]
5+
#![feature(cfg_eval)]
6+
#![feature(try_blocks)]
7+
#![cfg_attr(feature = "dat2", feature(iter_array_chunks))]
48
#![allow(clippy::result_large_err, unexpected_cfgs)]
59
#![warn(
610
unused_qualifications,

rs3cache_backend/src/xtea.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ impl Xtea {
4848

4949
pub fn decrypt(input: impl AsRef<[u8]>, xtea: Xtea) -> Vec<u8> {
5050
let input = input.as_ref();
51-
let mut iter = input.array_chunks::<8>();
52-
let mut output: Vec<u8> = iter.by_ref().flat_map(|block| Xtea::decrypt_block(*block, &xtea)).collect();
51+
let mut iter = input.iter().copied().array_chunks::<8>();
52+
let mut output: Vec<u8> = iter.by_ref().flat_map(|block| Xtea::decrypt_block(block, &xtea)).collect();
5353

54-
output.extend(iter.remainder());
54+
output.extend(iter.into_remainder());
5555
output
5656
}
5757
}

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "nightly-2025-03-01"
2+
channel = "nightly-2026-07-05"
33
components = [ "rustfmt", "clippy" ]
44
profile = "minimal"

src/definitions/enums.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ use serde::Serialize;
2121

2222
use crate::definitions::indextype::IndexType;
2323

24-
#[derive(Debug, PartialEq, Eq, Hash, Serialize, Clone, Copy)]
24+
#[derive(Debug, PartialEq, Eq, Hash, Serialize, Clone, Copy, Default)]
2525
pub enum KeyType {
26+
#[default]
2627
Uninit = -1,
2728
Int0 = 0,
2829
Int9 = 9,
@@ -87,14 +88,9 @@ impl KeyType {
8788
}
8889
}
8990

90-
impl Default for KeyType {
91-
fn default() -> Self {
92-
Self::Uninit
93-
}
94-
}
95-
96-
#[derive(Debug, PartialEq, Eq, Hash, Serialize, Clone, Copy)]
91+
#[derive(Debug, PartialEq, Eq, Hash, Serialize, Clone, Copy, Default)]
9792
pub enum ValueType {
93+
#[default]
9894
Uninit = -1,
9995
Int0 = 0,
10096
Int1 = 1,
@@ -192,12 +188,6 @@ impl ValueType {
192188
}
193189
}
194190

195-
impl Default for ValueType {
196-
fn default() -> Self {
197-
Self::Uninit
198-
}
199-
}
200-
201191
#[derive(Serialize, Debug, Eq, PartialEq, Clone)]
202192
#[serde(untagged)]
203193
pub enum Value {

src/ffi/python/mapsquares.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,10 +191,7 @@ impl PyMapSquare {
191191
file: crate::definitions::indextype::MapFileType::WATER_LOCATIONS,
192192
})
193193
.context(error::Integrity)?;
194-
let water_locations = match water_locations {
195-
Ok(v) => v,
196-
Err(e) => return Err(e.into()),
197-
};
194+
let water_locations = water_locations.as_ref()?;
198195
Ok(PyList::new(py, water_locations.iter().copied()))
199196
}
200197

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#![doc = include_str!("../README.md")]
2-
#![feature(cfg_eval, doc_cfg, try_blocks, yeet_expr)]
3-
#![allow(clippy::too_many_arguments, clippy::type_complexity)]
2+
#![feature(doc_cfg)]
3+
#![feature(try_blocks)]
4+
#![feature(yeet_expr)]
5+
#![allow(clippy::too_many_arguments, clippy::type_complexity, clippy::result_large_err)]
46
#![warn(
57
unused_qualifications,
68
unused_import_braces,

0 commit comments

Comments
 (0)