From 44fe6b7d5bde6de72cad7f724b9c546ddefd1f09 Mon Sep 17 00:00:00 2001 From: Maximilian Ammann Date: Sat, 12 Mar 2022 18:54:06 +0100 Subject: [PATCH] Run clippy --- benches/tessellation.rs | 3 +-- src/io/static_tile_fetcher.rs | 9 ++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/benches/tessellation.rs b/benches/tessellation.rs index 12ecee9a..c7e09937 100644 --- a/benches/tessellation.rs +++ b/benches/tessellation.rs @@ -1,7 +1,6 @@ use criterion::{criterion_group, criterion_main, Criterion}; use lyon::tessellation::VertexBuffers; use mapr::benchmarking::io::static_tile_fetcher::StaticTileFetcher; -use mapr::benchmarking::io::{HttpFetcherConfig, TileFetcher}; use mapr::benchmarking::tessellation::Tessellated; use std::io::Cursor; use vector_tile::parse_tile_reader; @@ -16,7 +15,7 @@ fn tile1(c: &mut Criterion) { const MUNICH_Y: u32 = 11365; const MUNICH_Z: u8 = 15; - let fetcher = StaticTileFetcher::new(HttpFetcherConfig::default()); + let fetcher = StaticTileFetcher::new(); let tile = parse_tile_reader(&mut Cursor::new( fetcher .sync_fetch_tile(&(MUNICH_X, MUNICH_Y, MUNICH_Z).into()) diff --git a/src/io/static_tile_fetcher.rs b/src/io/static_tile_fetcher.rs index e8b6e1f0..f871967c 100644 --- a/src/io/static_tile_fetcher.rs +++ b/src/io/static_tile_fetcher.rs @@ -16,15 +16,15 @@ impl StaticTileFetcher { concat!(env!("OUT_DIR"), "/extracted-tiles") } - fn new() -> Self { + pub fn new() -> Self { Self {} } - async fn fetch_tile(&self, coords: &TileCoords) -> Result, Error> { + pub async fn fetch_tile(&self, coords: &TileCoords) -> Result, Error> { self.sync_fetch_tile(coords) } - fn sync_fetch_tile(&self, coords: &TileCoords) -> Result, Error> { + pub fn sync_fetch_tile(&self, coords: &TileCoords) -> Result, Error> { if TILES.entries().is_empty() { error!( "There are not tiles statically embedded in this binary! StaticTileFetcher will \ @@ -44,7 +44,6 @@ mod tests { use style_spec::source::TileAdressingScheme; use crate::coords::WorldTileCoords; - use crate::io::{HttpFetcherConfig, TileFetcher}; use super::StaticTileFetcher; @@ -54,7 +53,7 @@ mod tests { const MUNICH_Y: i32 = 11365; const MUNICH_Z: u8 = 15; - let fetcher = StaticTileFetcher::new(HttpFetcherConfig::default()); + let fetcher = StaticTileFetcher::new(); assert!(fetcher.fetch_tile(&(0, 0, 0).into()).await.is_err()); // World overview let world_tile: WorldTileCoords = (MUNICH_X, MUNICH_Y, MUNICH_Z).into(); assert!(fetcher