When I see a typo in a comment, I usually don't really care. When I see a typo in a variable or method name, I request a change. Bad things happen, though, when I see that very method being used all over the place by the very developer who wrote the code, even though they know that they made a typo, because they spelled the word right everywhere else... just... WHY?
trait Round {
fn ridius(&self) -> f32; // Y U NO CORRECT THIZ???
}
struct Circle {
radius: f32,
}
impl Round for Circle {
fn ridius(&self) -> f32 { // OH, the PAIN
self.radius
}
}
impl Circle {
fn new(radius: f32) -> Self {
Self{radius}
}
fn set_radius(&mut self, radius: f32) {
self.radius = radius;
}
}
fn main() {
let circle = Circle::new(5.);
println!("Radius is: {}", circle.ridius()); // Just NOoooOOO
}