Skip to content

Commit 2f1d7bb

Browse files
mbround18claude
andcommitted
chore: bump Rust dependency versions, fix flaky tests, clean up clippy lints
Renovate-style patch/minor bumps across huginn/odin/shared (tokio, serde, regex, handlebars, sysinfo, thiserror, etc.). Removes valheim-postcopy.sh, whose Dockerfile invocation was already commented out. Also fixes 3 pre-existing flaky discord notification tests: they didn't set $NAME or use #[serial], so they'd race with other tests mutating the NAME env var and panic when falling back to a nonexistent config file. Applies cargo clippy --fix and cargo fmt for pre-existing lint/format issues (unrelated to the dependency bump, but blocking the pre-commit hook). Co-Authored-By: Claude <noreply@anthropic.com>
1 parent a1ca566 commit 2f1d7bb

18 files changed

Lines changed: 298 additions & 481 deletions

File tree

Cargo.lock

Lines changed: 213 additions & 389 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/huginn/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ name = "huginn"
1515
path = "main.rs"
1616

1717
[build-dependencies]
18-
cc = "1.2.64"
18+
cc = "1.3.0"
1919

2020
[dependencies]
21-
log = "0.4.32"
22-
tokio = { version = "1.52.3", features = ["full"] }
21+
log = "0.4.33"
22+
tokio = { version = "1.53.1", features = ["full"] }
2323
warp = { version = "0.4.3", features = ["server"] }
24-
serde = { version = "1.0.228", features = ["derive"], default-features = false }
25-
serde_json = "1.0.150"
24+
serde = { version = "1.0.229", features = ["derive"], default-features = false }
25+
serde_json = "1.0.151"
2626
a2s = "0.6.1"
2727

2828
[dependencies.odin]
@@ -43,4 +43,4 @@ features = [
4343
]
4444

4545
[dev-dependencies]
46-
regex = "1.12.4"
46+
regex = "1.13.1"

src/huginn/routes/metrics.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ pub fn invoke() -> String {
2020
let content = [
2121
format!(
2222
"valheim_online{labels} {online}",
23-
labels = &labels,
23+
labels = labels,
2424
online = info.online as i32
2525
),
2626
format!(
2727
"valheim_current_player_count{labels} {players}",
28-
labels = &labels,
29-
players = &info.players
28+
labels = labels,
29+
players = info.players
3030
),
3131
format!(
3232
"valheim_max_player_count{labels} {players}",
33-
labels = &labels,
34-
players = &info.max_players
33+
labels = labels,
34+
players = info.max_players
3535
),
3636
format!(
3737
"valheim_bepinex_installed{labels} {bepinex_installed}",
38-
labels = &labels,
38+
labels = labels,
3939
bepinex_installed = info.bepinex.enabled as i32
4040
),
4141
// System metrics (no labels beyond server identity)

src/odin/Cargo.toml

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,22 +22,22 @@ name = "odin"
2222
path = "lib.rs"
2323

2424
[build-dependencies]
25-
cc = "1.2.64"
25+
cc = "1.3.0"
2626

2727
[dependencies]
28-
handlebars = "6.4.1"
28+
handlebars = "6.4.3"
2929
dotenv = "0.15.0"
30-
log = "0.4.32"
31-
clap = { version = "4.6.1", features = ["derive", "env"] }
32-
which = "8.0.4"
33-
serde = { version = "1.0.228", features = ["derive"], default-features = false }
34-
sysinfo = { version = "0.39.3" }
35-
serde_json = "1.0.150"
30+
log = "0.4.33"
31+
clap = { version = "4.6.3", features = ["derive", "env"] }
32+
which = "8.0.5"
33+
serde = { version = "1.0.229", features = ["derive"], default-features = false }
34+
sysinfo = { version = "0.39.6" }
35+
serde_json = "1.0.151"
3636
daemonize = "0.5.0"
3737
tar = "0.4.46"
3838
flate2 = "1.1.9"
3939
inflections = "1.1.1"
40-
md5 = "0.8.0"
40+
md5 = "0.8.1"
4141
reqwest = { version = "0.13.4", default-features = false, features = [
4242
"blocking",
4343
"json",
@@ -49,13 +49,13 @@ fs_extra = "1.3.0"
4949
glob = "0.3.3"
5050
a2s = "0.6.1"
5151
serde_with = "3.21.0"
52-
regex = "1.12.4"
53-
tokio = { version = "1.52.3", features = ["full"] }
52+
regex = "1.13.1"
53+
tokio = { version = "1.53.1", features = ["full"] }
5454
notify = "8.2.0"
5555
json-patch = "4.2.0"
5656
cached = "2.0.2"
57-
anyhow = "1.0.102"
58-
thiserror = "2.0.18"
57+
anyhow = "1.0.104"
58+
thiserror = "2.0.19"
5959
tempfile = "3.27.0"
6060
walkdir = "2.5.0"
6161
sha2 = "0.11.0"
@@ -66,12 +66,12 @@ workspace = true
6666

6767
[dev-dependencies]
6868
once_cell = "1.21.4"
69-
rand = "0.10.1"
69+
rand = "0.10.2"
7070
serial_test = "3.5.0"
7171
mockito = "1.7.2"
7272
lazy_static = "1.5.0"
7373
test-case = "3.3.1"
74-
mockall = "0.14.0"
74+
mockall = "0.15.0"
7575

7676

7777
[dev-dependencies.cargo-husky]

src/odin/commands/backup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub fn invoke(input: String, output: String) {
1111
let tar_gz = match File::create(&output) {
1212
Ok(file) => file,
1313
Err(_) => {
14-
error!("Failed to create backup file at {}", &output);
14+
error!("Failed to create backup file at {}", output);
1515
exit(1)
1616
}
1717
};

src/odin/commands/start.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ pub fn invoke(dry_run: bool) {
2626
info!(
2727
target: "commands_start",
2828
"This command would have launched\n{} -nographics -batchmode -port {} -name {} -world {} -password {} -public {}",
29-
&config.command,
30-
&config.port,
31-
&config.name,
32-
&config.world,
33-
&config.password,
34-
&config.public,
29+
config.command,
30+
config.port,
31+
config.name,
32+
config.world,
33+
config.password,
34+
config.public,
3535
)
3636
}
3737
}

src/odin/errors/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ impl error::Error for VariantNotFound {}
1010

1111
impl Display for VariantNotFound {
1212
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
13-
write!(f, "VariantNotFound: {}", &self.v)
13+
write!(f, "VariantNotFound: {}", self.v)
1414
}
1515
}
1616

src/odin/files/config.rs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,33 +81,33 @@ impl TryInto<Vec<String>> for ValheimArguments {
8181
let mut args = Vec::new();
8282
// Sets the port of the server, (Can be set with ENV variable PORT)
8383
let port = fetch_var("PORT", &self.port);
84-
debug!("Setting port to: {}", &port);
84+
debug!("Setting port to: {}", port);
8585
args.push(String::from("-port"));
8686
args.push(port);
8787

8888
// Sets the name of the server, (Can be set with ENV variable NAME)
8989
let name = fetch_var("NAME", &self.name);
90-
debug!("Setting name to: {}", &name);
90+
debug!("Setting name to: {}", name);
9191
args.push(String::from("-name"));
9292
// Arg processor needs the quotes around the name if it has spaces
9393
args.push(format!("'{}'", name));
9494

9595
// Sets the world of the server, (Can be set with ENV variable WORLD)
9696
let world = fetch_var("WORLD", &self.world);
97-
debug!("Setting world to: {}", &world);
97+
debug!("Setting world to: {}", world);
9898
args.push(String::from("-world"));
9999
args.push(world);
100100

101101
// Determines if the server is public or not
102102
let public = fetch_var("PUBLIC", &self.public);
103-
debug!("Setting public to: {}", &public);
103+
debug!("Setting public to: {}", public);
104104
args.push(String::from("-public"));
105105
args.push(public.clone());
106106

107107
// Sets the save interval in seconds
108108
if let Some(save_interval) = &self.save_interval {
109109
let interval = save_interval.to_string();
110-
debug!("Setting save interval to: {}", &interval);
110+
debug!("Setting save interval to: {}", interval);
111111
args.push(String::from("-saveinterval"));
112112
args.push(interval);
113113
};
@@ -119,26 +119,23 @@ impl TryInto<Vec<String>> for ValheimArguments {
119119
.map(|key| key.trim())
120120
.filter(|key| !key.is_empty())
121121
.for_each(|key| {
122-
debug!("Setting set_key to: {}", &key);
122+
debug!("Setting set_key to: {}", key);
123123
args.push(String::from("-setkey"));
124124
args.push(key.to_string());
125125
});
126126
};
127127

128128
// Add preset to the command
129129
if let Some(preset) = &self.preset {
130-
debug!("Setting preset to: {}", &preset);
130+
debug!("Setting preset to: {}", preset);
131131
args.push(String::from("-preset"));
132132
args.push(preset.to_string());
133133
};
134134

135135
// Add modifiers to the command
136136
if let Some(modifiers) = &self.modifiers {
137137
modifiers.iter().for_each(|modifier| {
138-
debug!(
139-
"Setting modifier to: {} {}",
140-
&modifier.name, &modifier.value
141-
);
138+
debug!("Setting modifier to: {} {}", modifier.name, modifier.value);
142139
args.push(String::from("-modifier"));
143140
args.push(modifier.name.to_string());
144141
args.push(modifier.value.to_string());

src/odin/mods/bepinex.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ impl BepInExEnvironment {
162162
pub fn new() -> BepInExEnvironment {
163163
let game_dir = game_directory();
164164
let bepinex_dir = bepinex_directory();
165-
let bepinex_preloader_dll = format!("{}/core/BepInEx.Preloader.dll", &bepinex_dir);
165+
let bepinex_preloader_dll = format!("{}/core/BepInEx.Preloader.dll", bepinex_dir);
166166

167167
// Detect BepInExPack_Valheim version from manifest.json if present and cross-check filesystem
168168
let mut doorstop_is_v4_plus =
@@ -173,15 +173,15 @@ impl BepInExEnvironment {
173173

174174
debug!("Parsing Doorstop locations.");
175175
let doorstop_lib_default = if doorstop_is_v4_plus {
176-
format!("{}/doorstop_libs/libdoorstop_x64.so", &game_dir)
176+
format!("{}/doorstop_libs/libdoorstop_x64.so", game_dir)
177177
} else {
178178
String::from("libdoorstop_x64.so")
179179
};
180180
let doorstop_lib = environment::fetch_var(DOORSTOP_LIB_VAR, &doorstop_lib_default);
181181
let doorstop_libs = parse_path(
182182
DOORSTOP_LIBS_VAR,
183-
format!("{}/doorstop_libs", &game_dir),
184-
format!("{}/doorstop", &bepinex_dir),
183+
format!("{}/doorstop_libs", game_dir),
184+
format!("{}/doorstop", bepinex_dir),
185185
);
186186
let doorstop_target_assembly =
187187
environment::fetch_var(DOORSTOP_TARGET_ASSEMBLY_VAR, &bepinex_preloader_dll);
@@ -190,15 +190,15 @@ impl BepInExEnvironment {
190190
// Prefer BepInEx/core_lib, fallback to BepInEx/core; no more game_dir/unstripped_corlib
191191
let doorstop_corlib_override_path = parse_path(
192192
DOORSTOP_CORLIB_OVERRIDE_PATH_VAR,
193-
format!("{}/core_lib", &bepinex_dir),
194-
format!("{}/core", &bepinex_dir),
193+
format!("{}/core_lib", bepinex_dir),
194+
format!("{}/core", bepinex_dir),
195195
);
196196

197197
debug!("Parsing LD locations.");
198198
let ld_preload = environment::fetch_var(constants::LD_PRELOAD_VAR, "").add(&doorstop_lib);
199199
let ld_library_path = environment::fetch_var(
200200
constants::LD_LIBRARY_PATH_VAR,
201-
format!("./linux64:{}", &doorstop_libs).as_str(),
201+
format!("./linux64:{}", doorstop_libs).as_str(),
202202
);
203203

204204
debug!("Returning environment");
@@ -221,8 +221,8 @@ impl BepInExEnvironment {
221221
debug!("Checking for BepInEx specific files...");
222222
// Choose checks based on detected mode
223223
// For Doorstop v4+: verify native lib in doorstop_libs dir (Linux .so or macOS .dylib)
224-
let lib_so = format!("{}/libdoorstop_x64.so", &self.doorstop_libs_dir);
225-
let lib_dylib = format!("{}/libdoorstop_64.dylib", &self.doorstop_libs_dir);
224+
let lib_so = format!("{}/libdoorstop_x64.so", self.doorstop_libs_dir);
225+
let lib_dylib = format!("{}/libdoorstop_64.dylib", self.doorstop_libs_dir);
226226
let checks_v4 = [&self.doorstop_target_assembly];
227227
let checks_v3 = [&self.doorstop_lib, &self.doorstop_invoke_dll];
228228
let expected_state = true;
@@ -231,21 +231,21 @@ impl BepInExEnvironment {
231231
let dylib_exists = path_exists(&lib_dylib);
232232
let target_exists = path_exists(&self.doorstop_target_assembly);
233233
debug!("Doorstop v4+ checks:");
234-
debug!(" - lib (so): {} => {}", &lib_so, so_exists);
235-
debug!(" - lib (dylib): {} => {}", &lib_dylib, dylib_exists);
234+
debug!(" - lib (so): {} => {}", lib_so, so_exists);
235+
debug!(" - lib (dylib): {} => {}", lib_dylib, dylib_exists);
236236
debug!(
237237
" - target assembly: {} => {}",
238-
&self.doorstop_target_assembly, target_exists
238+
self.doorstop_target_assembly, target_exists
239239
);
240240
(so_exists || dylib_exists) && checks_v4.iter().all(|v| path_exists(v) == expected_state)
241241
} else {
242242
let lib_exists = path_exists(&self.doorstop_lib);
243243
let invoke_exists = path_exists(&self.doorstop_invoke_dll);
244244
debug!("Doorstop v3 checks:");
245-
debug!(" - doorstop_lib: {} => {}", &self.doorstop_lib, lib_exists);
245+
debug!(" - doorstop_lib: {} => {}", self.doorstop_lib, lib_exists);
246246
debug!(
247247
" - invoke dll: {} => {}",
248-
&self.doorstop_invoke_dll, invoke_exists
248+
self.doorstop_invoke_dll, invoke_exists
249249
);
250250
checks_v3.iter().all(|v| path_exists(v) == expected_state)
251251
};

src/odin/mods/manifest.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ impl TryFrom<PathBuf> for Manifest {
1616
type Error = Box<dyn std::error::Error>;
1717

1818
fn try_from(value: PathBuf) -> Result<Self, Self::Error> {
19-
debug!("Reading Manifest from {:?}", &value);
19+
debug!("Reading Manifest from {:?}", value);
2020

2121
if !value.exists() {
2222
return Err(Box::new(ManifestDeserializeError(format!(
2323
"Failed to find manifest at {:?}",
24-
&value
24+
value
2525
))));
2626
}
2727

@@ -32,7 +32,7 @@ impl TryFrom<PathBuf> for Manifest {
3232
if content.trim().is_empty() {
3333
return Err(Box::new(ManifestDeserializeError(format!(
3434
"Manifest file at {:?} is empty",
35-
&value
35+
value
3636
))));
3737
}
3838

0 commit comments

Comments
 (0)