//! Native armor/toughness and enchantment-protection damage arithmetic.
fn clamp(value: f32, min: f32, max: f32) -> f32 {
if value < min {
min
} else if value.is_nan() || max.is_nan() {
f32::NAN
} else if value == 0.0 && max == 0.0 {
f32::from_bits(value.to_bits() | max.to_bits())
} else {
value.min(max)
}
}
pub trait ArmorWorld {
type Error;
type Weapon: Copy;
type ServerLevel: Copy;
fn weapon(&mut self) -> Result