fix(simulation): Clippy cleanup and CI enforcement (#635)
Fix all Clippy warnings across the server codebase (2411 insertions, 1341 deletions). Raise type-complexity-threshold to 750 and too-many-arguments to 12 in .clippy.toml for idiomatic Bevy ECS system signatures. The server now passes `cargo clippy -- --deny warnings` cleanly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -192,13 +192,12 @@ pub struct SettingsPlugin;
|
||||
|
||||
impl Plugin for SettingsPlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.init_resource::<SettingsCommandBuffer>()
|
||||
.add_systems(
|
||||
Update,
|
||||
process_settings_commands
|
||||
.after(crate::simulation::input::process_player_input)
|
||||
.before(crate::perception::observer::compute_observer_snapshot),
|
||||
);
|
||||
app.init_resource::<SettingsCommandBuffer>().add_systems(
|
||||
Update,
|
||||
process_settings_commands
|
||||
.after(crate::simulation::input::process_player_input)
|
||||
.before(crate::perception::observer::compute_observer_snapshot),
|
||||
);
|
||||
tracing::debug!("SettingsPlugin initialized");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,10 +129,7 @@ impl SettingsStore {
|
||||
}
|
||||
|
||||
/// Get all settings as a Vec<SettingEntry> for wire serialization.
|
||||
pub fn get_all_entries(
|
||||
&self,
|
||||
player_id: &str,
|
||||
) -> Result<Vec<SettingEntry>, rusqlite::Error> {
|
||||
pub fn get_all_entries(&self, player_id: &str) -> Result<Vec<SettingEntry>, rusqlite::Error> {
|
||||
self.get_all(player_id).map(|map| {
|
||||
map.into_iter()
|
||||
.map(|(key, value)| SettingEntry { key, value })
|
||||
@@ -175,7 +172,10 @@ fn columns_to_value(
|
||||
"float" => Ok(SettingValue::Float(row.get::<_, f64>(offset + 2)?)),
|
||||
"bool" => Ok(SettingValue::Bool(row.get::<_, bool>(offset + 3)?)),
|
||||
other => {
|
||||
tracing::warn!("unknown settings value_type '{}', treating as String", other);
|
||||
tracing::warn!(
|
||||
"unknown settings value_type '{}', treating as String",
|
||||
other
|
||||
);
|
||||
Ok(SettingValue::String(format!("<unknown type: {}>", other)))
|
||||
}
|
||||
}
|
||||
@@ -252,14 +252,16 @@ mod tests {
|
||||
#[test]
|
||||
fn player_isolation() {
|
||||
let store = test_store();
|
||||
store
|
||||
.set("p1", "volume", &SettingValue::Int(50))
|
||||
.unwrap();
|
||||
store
|
||||
.set("p2", "volume", &SettingValue::Int(90))
|
||||
.unwrap();
|
||||
assert_eq!(store.get("p1", "volume").unwrap(), Some(SettingValue::Int(50)));
|
||||
assert_eq!(store.get("p2", "volume").unwrap(), Some(SettingValue::Int(90)));
|
||||
store.set("p1", "volume", &SettingValue::Int(50)).unwrap();
|
||||
store.set("p2", "volume", &SettingValue::Int(90)).unwrap();
|
||||
assert_eq!(
|
||||
store.get("p1", "volume").unwrap(),
|
||||
Some(SettingValue::Int(50))
|
||||
);
|
||||
assert_eq!(
|
||||
store.get("p2", "volume").unwrap(),
|
||||
Some(SettingValue::Int(90))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in New Issue
Block a user