refactor(server): fix clippy warnings from Rust 1.93
- Use #[derive(Default)] + #[default] instead of manual Default impls for FacingDirection, KnowledgeState, RelationshipState, EntityVisibility - Replace manual modulo check with .is_multiple_of() - Collapse nested if in shadowcast symmetry check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -47,8 +47,9 @@ pub struct GameTime {
|
||||
|
||||
/// 8-directional facing direction, matching movement system.
|
||||
/// Used for vision cone computation (D-015) and snapshot wire format.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default, Serialize, Deserialize)]
|
||||
pub enum FacingDirection {
|
||||
#[default]
|
||||
North,
|
||||
Northeast,
|
||||
East,
|
||||
@@ -59,12 +60,6 @@ pub enum FacingDirection {
|
||||
Northwest,
|
||||
}
|
||||
|
||||
impl Default for FacingDirection {
|
||||
fn default() -> Self {
|
||||
FacingDirection::North
|
||||
}
|
||||
}
|
||||
|
||||
/// A tile visible to the observer with its visibility quality
|
||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||
pub struct VisibleTile {
|
||||
|
||||
Reference in New Issue
Block a user