1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-23 22:13:02 +02:00

20221228 revert the points length check

This commit is contained in:
Der Chien 2022-12-28 22:39:52 +08:00 committed by GitHub
parent 42494f95ab
commit 0b77fc6bf3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -84,8 +84,8 @@ impl Polygon {
}
pub fn length(&self) -> f64 {
if self.points.len() < 3 {
return f64::NAN;
if self.points.is_empty() {
return 0.0;
}
let mut result = 0.0;