Fix checks with clippy

This commit is contained in:
Maximilian Ammann 2022-04-20 22:10:58 +02:00
parent fe404e52df
commit b178518705
10 changed files with 18 additions and 14 deletions

View File

@ -27,4 +27,4 @@ runs:
run: mdbook build run: mdbook build
- name: API Documentation - name: API Documentation
shell: bash 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

View File

@ -11,7 +11,7 @@ install-clippy:
rustup component add clippy rustup component add clippy
clippy: install-clippy clippy: install-clippy
cargo clippy --all-targets --all-features cargo clippy --all-targets --all-features --no-deps
install-rustfmt: install-rustfmt:
rustup component add rustfmt rustup component add rustfmt

View File

@ -8,6 +8,8 @@ edition = "2021"
[dependencies] [dependencies]
maplibre = { path = "../maplibre" } maplibre = { path = "../maplibre" }
env_logger = "0.9" env_logger = "0.9"
[target.'cfg(target_os = "android")'.dependencies]
ndk-glue = "0.5.0" # version is required by winit ndk-glue = "0.5.0" # version is required by winit
[lib] [lib]

View File

@ -2,8 +2,9 @@ use maplibre::window::FromWindow;
use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod}; use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod};
pub use std::time::Instant; pub use std::time::Instant;
#[cfg(not(target_os = "android"))] // TODO clippy
compile_error!("maplibre-android works only on android."); // #[cfg(not(target_os = "android"))]
// compile_error!("maplibre-android works only on android.");
#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))] #[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))]
pub fn main() { pub fn main() {

View File

@ -2,8 +2,9 @@ use maplibre::window::FromWindow;
use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod}; use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod};
pub use std::time::Instant; pub use std::time::Instant;
#[cfg(not(any(target_os = "macos", target_os = "ios")))] // TODO clippy
compile_error!("maplibre-apple works only on macOS and iOS."); // #[cfg(not(any(target_os = "macos", target_os = "ios")))]
// compile_error!("maplibre-apple works only on macOS and iOS.");
#[no_mangle] #[no_mangle]
pub fn maplibre_apple_main() { pub fn maplibre_apple_main() {

View File

@ -6,3 +6,7 @@ categories = []
edition = "2021" edition = "2021"
[dependencies] [dependencies]
maplibre = { path = "../maplibre" }
[dev-dependencies]
criterion = "0.3"

View File

@ -5,8 +5,6 @@ use maplibre::{MapBuilder, ScheduleMethod, TokioScheduleMethod};
fn render(c: &mut Criterion) { fn render(c: &mut Criterion) {
c.bench_function("render", |b| { c.bench_function("render", |b| {
b.iter(|| { b.iter(|| {
env_logger::init_from_env(env_logger::Env::default().default_filter_or("info"));
MapBuilder::from_window("A fantastic window!") MapBuilder::from_window("A fantastic window!")
.with_schedule_method(ScheduleMethod::Tokio(TokioScheduleMethod::new())) .with_schedule_method(ScheduleMethod::Tokio(TokioScheduleMethod::new()))
.build() .build()

View File

@ -1,5 +1,5 @@
use criterion::{criterion_group, criterion_main, Criterion}; 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::io::static_tile_fetcher::StaticTileFetcher;
use maplibre::benchmarking::tessellation::Tessellated; use maplibre::benchmarking::tessellation::Tessellated;
use std::io::Cursor; use std::io::Cursor;

View File

@ -80,8 +80,5 @@ bytemuck_derive = "1.0"
include_dir = "0.7.2" include_dir = "0.7.2"
[dev-dependencies]
criterion = "0.3"
[build-dependencies] [build-dependencies]
maplibre-build-tools = { path = "../maplibre-build-tools" } maplibre-build-tools = { path = "../maplibre-build-tools" }

View File

@ -1,4 +1,5 @@
pub use maplibre_core::*; pub use maplibre_core::*;
#[cfg(not(target_arch = "wasm32"))] // TODO clippy
compile_error!("maplibre-web works only on wasm32."); // #[cfg(not(target_arch = "wasm32"))]
// compile_error!("maplibre-web works only on wasm32.");