Run clippy

This commit is contained in:
Maximilian Ammann 2022-03-12 18:54:06 +01:00
parent a4d6469c47
commit 44fe6b7d5b
2 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion}; use criterion::{criterion_group, criterion_main, Criterion};
use lyon::tessellation::VertexBuffers; use lyon::tessellation::VertexBuffers;
use mapr::benchmarking::io::static_tile_fetcher::StaticTileFetcher; use mapr::benchmarking::io::static_tile_fetcher::StaticTileFetcher;
use mapr::benchmarking::io::{HttpFetcherConfig, TileFetcher};
use mapr::benchmarking::tessellation::Tessellated; use mapr::benchmarking::tessellation::Tessellated;
use std::io::Cursor; use std::io::Cursor;
use vector_tile::parse_tile_reader; use vector_tile::parse_tile_reader;
@ -16,7 +15,7 @@ fn tile1(c: &mut Criterion) {
const MUNICH_Y: u32 = 11365; const MUNICH_Y: u32 = 11365;
const MUNICH_Z: u8 = 15; const MUNICH_Z: u8 = 15;
let fetcher = StaticTileFetcher::new(HttpFetcherConfig::default()); let fetcher = StaticTileFetcher::new();
let tile = parse_tile_reader(&mut Cursor::new( let tile = parse_tile_reader(&mut Cursor::new(
fetcher fetcher
.sync_fetch_tile(&(MUNICH_X, MUNICH_Y, MUNICH_Z).into()) .sync_fetch_tile(&(MUNICH_X, MUNICH_Y, MUNICH_Z).into())

View File

@ -16,15 +16,15 @@ impl StaticTileFetcher {
concat!(env!("OUT_DIR"), "/extracted-tiles") concat!(env!("OUT_DIR"), "/extracted-tiles")
} }
fn new() -> Self { pub fn new() -> Self {
Self {} Self {}
} }
async fn fetch_tile(&self, coords: &TileCoords) -> Result<Vec<u8>, Error> { pub async fn fetch_tile(&self, coords: &TileCoords) -> Result<Vec<u8>, Error> {
self.sync_fetch_tile(coords) self.sync_fetch_tile(coords)
} }
fn sync_fetch_tile(&self, coords: &TileCoords) -> Result<Vec<u8>, Error> { pub fn sync_fetch_tile(&self, coords: &TileCoords) -> Result<Vec<u8>, Error> {
if TILES.entries().is_empty() { if TILES.entries().is_empty() {
error!( error!(
"There are not tiles statically embedded in this binary! StaticTileFetcher will \ "There are not tiles statically embedded in this binary! StaticTileFetcher will \
@ -44,7 +44,6 @@ mod tests {
use style_spec::source::TileAdressingScheme; use style_spec::source::TileAdressingScheme;
use crate::coords::WorldTileCoords; use crate::coords::WorldTileCoords;
use crate::io::{HttpFetcherConfig, TileFetcher};
use super::StaticTileFetcher; use super::StaticTileFetcher;
@ -54,7 +53,7 @@ mod tests {
const MUNICH_Y: i32 = 11365; const MUNICH_Y: i32 = 11365;
const MUNICH_Z: u8 = 15; 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 assert!(fetcher.fetch_tile(&(0, 0, 0).into()).await.is_err()); // World overview
let world_tile: WorldTileCoords = (MUNICH_X, MUNICH_Y, MUNICH_Z).into(); let world_tile: WorldTileCoords = (MUNICH_X, MUNICH_Y, MUNICH_Z).into();
assert!(fetcher assert!(fetcher