mirror of
https://github.com/rust-lang-cn/book-cn.git
synced 2025-01-25 08:28:44 +08:00
Merge pull request #204 from ykomatsu/indentation
Fix wrong indentation
This commit is contained in:
commit
2c9c3b53bb
@ -344,12 +344,12 @@ struct Point {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Point {
|
impl Point {
|
||||||
fn distance(&self, other: &Point) -> f64 {
|
fn distance(&self, other: &Point) -> f64 {
|
||||||
let x_squared = f64::powi(other.x - self.x, 2);
|
let x_squared = f64::powi(other.x - self.x, 2);
|
||||||
let y_squared = f64::powi(other.y - self.y, 2);
|
let y_squared = f64::powi(other.y - self.y, 2);
|
||||||
|
|
||||||
f64::sqrt(x_squared + y_squared)
|
f64::sqrt(x_squared + y_squared)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let p1 = Point { x: 0.0, y: 0.0 };
|
let p1 = Point { x: 0.0, y: 0.0 };
|
||||||
|
@ -47,12 +47,12 @@ struct Point {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl Point {
|
impl Point {
|
||||||
fn distance(&self, other: &Point) -> f64 {
|
fn distance(&self, other: &Point) -> f64 {
|
||||||
let x_squared = f64::powi(other.x - self.x, 2);
|
let x_squared = f64::powi(other.x - self.x, 2);
|
||||||
let y_squared = f64::powi(other.y - self.y, 2);
|
let y_squared = f64::powi(other.y - self.y, 2);
|
||||||
|
|
||||||
f64::sqrt(x_squared + y_squared)
|
f64::sqrt(x_squared + y_squared)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let p1 = Point { x: 0.0, y: 0.0 };
|
let p1 = Point { x: 0.0, y: 0.0 };
|
||||||
|
Loading…
Reference in New Issue
Block a user