From b178518705c3c14f37e2fbb8fbd7dd80b88963c8 Mon Sep 17 00:00:00 2001 From: Maximilian Ammann Date: Wed, 20 Apr 2022 22:10:58 +0200 Subject: [PATCH] Fix checks with clippy --- .github/actions/docs/action.yml | 2 +- justfile | 2 +- maplibre-android/Cargo.toml | 2 ++ maplibre-android/src/lib.rs | 5 +++-- maplibre-apple/src/lib.rs | 5 +++-- maplibre-benchmark/Cargo.toml | 4 ++++ maplibre-benchmark/benches/render.rs | 2 -- maplibre-benchmark/benches/tessellation.rs | 2 +- maplibre-core/Cargo.toml | 3 --- maplibre-web/src/lib.rs | 5 +++-- 10 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/actions/docs/action.yml b/.github/actions/docs/action.yml index 0cbca8ea..ef53991c 100644 --- a/.github/actions/docs/action.yml +++ b/.github/actions/docs/action.yml @@ -27,4 +27,4 @@ runs: run: mdbook build - name: API Documentation shell: bash - run: cargo doc --no-deps --workspace --lib --all-features --document-private-items + run: cargo doc -p maplibre --no-deps --lib --all-features --document-private-items diff --git a/justfile b/justfile index 4e81d1dd..cd3067e0 100644 --- a/justfile +++ b/justfile @@ -11,7 +11,7 @@ install-clippy: rustup component add clippy clippy: install-clippy - cargo clippy --all-targets --all-features + cargo clippy --all-targets --all-features --no-deps install-rustfmt: rustup component add rustfmt diff --git a/maplibre-android/Cargo.toml b/maplibre-android/Cargo.toml index eadfc12c..7feef142 100644 --- a/maplibre-android/Cargo.toml +++ b/maplibre-android/Cargo.toml @@ -8,6 +8,8 @@ edition = "2021" [dependencies] maplibre = { path = "../maplibre" } env_logger = "0.9" + +[target.'cfg(target_os = "android")'.dependencies] ndk-glue = "0.5.0" # version is required by winit [lib] diff --git a/maplibre-android/src/lib.rs b/maplibre-android/src/lib.rs index 0d90b6f5..7d90379d 100644 --- a/maplibre-android/src/lib.rs +++ b/maplibre-android/src/lib.rs @@ -2,8 +2,9 @@ use maplibre::window::FromWindow; use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod}; pub use std::time::Instant; -#[cfg(not(target_os = "android"))] -compile_error!("maplibre-android works only on android."); +// TODO clippy +// #[cfg(not(target_os = "android"))] +// compile_error!("maplibre-android works only on android."); #[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))] pub fn main() { diff --git a/maplibre-apple/src/lib.rs b/maplibre-apple/src/lib.rs index 269f4c4d..c3452a37 100644 --- a/maplibre-apple/src/lib.rs +++ b/maplibre-apple/src/lib.rs @@ -2,8 +2,9 @@ use maplibre::window::FromWindow; use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod}; pub use std::time::Instant; -#[cfg(not(any(target_os = "macos", target_os = "ios")))] -compile_error!("maplibre-apple works only on macOS and iOS."); +// TODO clippy +// #[cfg(not(any(target_os = "macos", target_os = "ios")))] +// compile_error!("maplibre-apple works only on macOS and iOS."); #[no_mangle] pub fn maplibre_apple_main() { diff --git a/maplibre-benchmark/Cargo.toml b/maplibre-benchmark/Cargo.toml index 95e6b24a..3f18064a 100644 --- a/maplibre-benchmark/Cargo.toml +++ b/maplibre-benchmark/Cargo.toml @@ -6,3 +6,7 @@ categories = [] edition = "2021" [dependencies] +maplibre = { path = "../maplibre" } + +[dev-dependencies] +criterion = "0.3" diff --git a/maplibre-benchmark/benches/render.rs b/maplibre-benchmark/benches/render.rs index d91bb01a..6fbbff46 100644 --- a/maplibre-benchmark/benches/render.rs +++ b/maplibre-benchmark/benches/render.rs @@ -5,8 +5,6 @@ use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod}; fn render(c: &mut Criterion) { c.bench_function("render", |b| { b.iter(|| { - env_logger::init_from_env(env_logger::Env::default().default_filter_or("info")); - MapBuilder::from_window("A fantastic window!") .with_schedule_method(ScheduleMethod::Tokio(TokioScheduleMethod::new())) .build() diff --git a/maplibre-benchmark/benches/tessellation.rs b/maplibre-benchmark/benches/tessellation.rs index 254a0dfd..4c6dc0f1 100644 --- a/maplibre-benchmark/benches/tessellation.rs +++ b/maplibre-benchmark/benches/tessellation.rs @@ -1,5 +1,5 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use lyon::tessellation::VertexBuffers; +// use lyon::tessellation::VertexBuffers; use maplibre::benchmarking::io::static_tile_fetcher::StaticTileFetcher; use maplibre::benchmarking::tessellation::Tessellated; use std::io::Cursor; diff --git a/maplibre-core/Cargo.toml b/maplibre-core/Cargo.toml index 8130da02..105eaff9 100644 --- a/maplibre-core/Cargo.toml +++ b/maplibre-core/Cargo.toml @@ -80,8 +80,5 @@ bytemuck_derive = "1.0" include_dir = "0.7.2" -[dev-dependencies] -criterion = "0.3" - [build-dependencies] maplibre-build-tools = { path = "../maplibre-build-tools" } diff --git a/maplibre-web/src/lib.rs b/maplibre-web/src/lib.rs index fbaa4ee2..f547d09a 100644 --- a/maplibre-web/src/lib.rs +++ b/maplibre-web/src/lib.rs @@ -1,4 +1,5 @@ pub use maplibre_core::*; -#[cfg(not(target_arch = "wasm32"))] -compile_error!("maplibre-web works only on wasm32."); +// TODO clippy +// #[cfg(not(target_arch = "wasm32"))] +// compile_error!("maplibre-web works only on wasm32.");