Skip to content

Commit

Permalink
Just fix some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dabreegster committed Dec 4, 2023
1 parent e62892d commit 91ca6df
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
5 changes: 2 additions & 3 deletions backend/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#[macro_use]
extern crate anyhow;
#[macro_use]
extern crate log;

use std::collections::HashMap;
use std::fmt;
use std::sync::Once;

use fast_paths::{FastGraph, PathCalculator};
use geo::{LineString, Point, Polygon};
use geo::{LineString, Point};
use geojson::{Feature, GeoJson, Geometry};
use rstar::{primitives::GeomWithData, RTree};
use serde::{Deserialize, Serialize};
Expand Down Expand Up @@ -62,6 +60,7 @@ pub struct Road {

pub struct Intersection {
id: IntersectionID,
#[allow(dead_code)]
node: osm::NodeID,
point: Point,
roads: Vec<RoadID>,
Expand Down
2 changes: 2 additions & 0 deletions backend/src/node_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ impl<T: Copy + Ord + Debug + Serialize> NodeMap<T> {
// A serialized NodeMap has this form in JSON. Use this to deserialize.
#[derive(Deserialize)]
struct InnerNodeMap<T: Copy + Ord + Debug> {
#[allow(dead_code)]
id_to_node: Vec<T>,
}

#[allow(dead_code)]
pub fn deserialize_nodemap<
'de,
D: Deserializer<'de>,
Expand Down
14 changes: 9 additions & 5 deletions backend/src/route.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use anyhow::{bail, Result};
use fast_paths::{FastGraph, InputGraph};
use geo::{HaversineLength, LineString};
use geojson::FeatureCollection;
use rstar::primitives::GeomWithData;
use rstar::RTree;

use crate::node_map::NodeMap;
Expand Down Expand Up @@ -86,10 +85,15 @@ pub fn do_route(map: &mut MapModel, req: CompareRouteRequest) -> Result<FeatureC
return Ok(FeatureCollection {
features,
bbox: None,
foreign_members: Some(serde_json::json!({
"direct_length": direct_length,
"route_length": route_length,
}).as_object().unwrap().clone()),
foreign_members: Some(
serde_json::json!({
"direct_length": direct_length,
"route_length": route_length,
})
.as_object()
.unwrap()
.clone(),
),
});
}
bail!("No path");
Expand Down
4 changes: 2 additions & 2 deletions backend/src/scrape.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::collections::HashMap;

use anyhow::Result;
use geo::{Coord, Geometry, GeometryCollection, LineString, MapCoordsInPlace, Point, Polygon};
use geo::{Coord, LineString, Point};

use crate::osm::{NodeID, OsmID, WayID};
use crate::osm::{NodeID, WayID};
use crate::parse_osm::Element;
use crate::{Intersection, IntersectionID, MapModel, Road, RoadID};

Expand Down

0 comments on commit 91ca6df

Please sign in to comment.