From 718acda08c5e70b04b4ddc87337421fdc4cd0cdc Mon Sep 17 00:00:00 2001 From: hanabi1224 Date: Wed, 4 Sep 2024 12:35:08 +0800 Subject: [PATCH] fix warnings --- build.rs | 10 ++++++++-- src/lib.rs | 1 + src/types/annoy_index_impl.rs | 1 - 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/build.rs b/build.rs index 3d73a14..65d918d 100644 --- a/build.rs +++ b/build.rs @@ -2,8 +2,14 @@ use rustc_version::{version_meta, Channel}; fn main() { match version_meta().unwrap().channel { - Channel::Nightly => println!("cargo:rustc-cfg=nightly"), - Channel::Beta => println!("cargo:rustc-cfg=beta"), + Channel::Nightly => { + println!("cargo::rustc-check-cfg=cfg(nightly)"); + println!("cargo:rustc-cfg=nightly"); + } + Channel::Beta => { + println!("cargo::rustc-check-cfg=cfg(beta)"); + println!("cargo:rustc-cfg=beta"); + } _ => {} }; } diff --git a/src/lib.rs b/src/lib.rs index 52f3cfd..45a6551 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,6 +14,7 @@ pub use types::*; pub mod wasm_exports; #[cfg(test)] +#[cfg(nightly)] mod tests { pub trait RoundTo { fn round_to(&self, n: usize) -> T; diff --git a/src/types/annoy_index_impl.rs b/src/types/annoy_index_impl.rs index aa5a0cf..a9d8076 100644 --- a/src/types/annoy_index_impl.rs +++ b/src/types/annoy_index_impl.rs @@ -4,7 +4,6 @@ use crate::internals::storage_ext::*; use crate::types::node::*; use crate::Storage; use std::error::Error; -use std::vec::Vec; impl AnnoyIndex { #[cfg(not(target_arch = "wasm32"))]