diff --git a/projects/panamint/src/geo/flat.rs b/projects/panamint/src/geo/flat.rs index 5f13bf6..c478425 100644 --- a/projects/panamint/src/geo/flat.rs +++ b/projects/panamint/src/geo/flat.rs @@ -72,7 +72,7 @@ impl Ruler { /// Return a new line created by interpolating points along the /// original line at equal intervals. pub fn resample_line(&self, geo: &[Point], meters: f32) -> Vec { - assert!(geo.len() > 0); + assert!(!geo.is_empty()); let mut resampled = vec![geo[0]]; @@ -192,17 +192,17 @@ mod tests { #[test] fn haversine_equivalence() { let base = &Point { - lng: 96.920341, - lat: 32.838261, + lng: 96.920_34, + lat: 32.838_26, }; let points: Vec = [ - (96.920341, 32.838261), - (96.920421, 32.838295), - (96.920421, 32.838295), - (96.920536, 32.838297), - (96.920684, 32.838293), - (96.920818, 32.838342), + (96.920_34, 32.838_26), + (96.920_42, 32.838295), + (96.920_42, 32.838295), + (96.920_53, 32.838_3), + (96.920684, 32.838_29), + (96.920818, 32.838_34), ] .into_iter() .map(|(lng, lat)| Point { lng, lat }) @@ -237,17 +237,17 @@ mod tests { let pt = Point { lat: 38.882017, - lng: -77.034076, + lng: -77.034_07, }; let line = ( Point { lat: 38.878605, - lng: -77.031669, + lng: -77.031_67, }, Point { lat: 38.881946, - lng: -77.029609, + lng: -77.029_61, }, ); diff --git a/projects/panamint/src/main.rs b/projects/panamint/src/main.rs index d65cfc7..ade91e9 100644 --- a/projects/panamint/src/main.rs +++ b/projects/panamint/src/main.rs @@ -163,7 +163,6 @@ pub fn route_api_brouter( lat: lat.parse::().ok()?, }) }) - .into_iter() .collect::>>(); let (from, to) = match coords { diff --git a/projects/panamint/src/profile/parse.rs b/projects/panamint/src/profile/parse.rs index 054ec87..8568dad 100644 --- a/projects/panamint/src/profile/parse.rs +++ b/projects/panamint/src/profile/parse.rs @@ -202,7 +202,6 @@ fn parse_tag_expr(pairs: pest::iterators::Pairs) -> Vec let key = parse_as_str(node.next().unwrap()); let op = node.next().unwrap(); let patterns = node - .into_iter() .map(|x| parse_as_str(x).into()) .collect::>(); @@ -275,7 +274,7 @@ profile "kitchen sink" { } "#; - let parsed = Grammar::parse(Rule::top_level, &input).expect("parse okay"); + let parsed = Grammar::parse(Rule::top_level, input).expect("parse okay"); for pair in parsed { println!("---> {:?}", pair); diff --git a/projects/panamint/src/profile/runtime.rs b/projects/panamint/src/profile/runtime.rs index 6f69d82..2792f23 100644 --- a/projects/panamint/src/profile/runtime.rs +++ b/projects/panamint/src/profile/runtime.rs @@ -236,7 +236,7 @@ impl<'a> Builder<'a> { let arg_range = match ty.arity() { Arity::Unary => 1..=1, - Arity::Variadic => (1..=usize::MAX), + Arity::Variadic => 1..=usize::MAX, }; if !arg_range.contains(&block.body.len()) { @@ -667,7 +667,7 @@ mod tests { tag_dict.insert(tag.into()); } - Runtime::from_source(&input, &tag_dict).expect("create runtime"); + Runtime::from_source(input, &tag_dict).expect("create runtime"); } #[test] @@ -690,7 +690,7 @@ profile "test" { tag_dict.insert(tag.into()); } - let runtime = Runtime::from_source(&input, &tag_dict).expect("create runtime"); + let runtime = Runtime::from_source(input, &tag_dict).expect("create runtime"); let expected = vec![ Value::Number(1.0),