Skip to content

Commit 08c77c7

Browse files
authored
Fix clippy in release build (#113)
1 parent 2f36adb commit 08c77c7

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

python/src/lib.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@ mod kdtree;
55
mod rtree;
66
pub(crate) mod util;
77

8-
use pyo3::exceptions::PyRuntimeWarning;
9-
use pyo3::intern;
108
use pyo3::prelude::*;
11-
use pyo3::types::PyTuple;
129

1310
const VERSION: &str = env!("CARGO_PKG_VERSION");
1411

@@ -19,15 +16,19 @@ fn ___version() -> &'static str {
1916

2017
/// Raise RuntimeWarning for debug builds
2118
#[pyfunction]
22-
fn check_debug_build(py: Python) -> PyResult<()> {
19+
fn check_debug_build(_py: Python) -> PyResult<()> {
2320
#[cfg(debug_assertions)]
2421
{
25-
let warnings_mod = py.import(intern!(py, "warnings"))?;
22+
use pyo3::exceptions::PyRuntimeWarning;
23+
use pyo3::intern;
24+
use pyo3::types::PyTuple;
25+
26+
let warnings_mod = _py.import(intern!(_py, "warnings"))?;
2627
let warning = PyRuntimeWarning::new_err(
2728
"geoindex-rs has not been compiled in release mode. Performance will be degraded.",
2829
);
29-
let args = PyTuple::new(py, vec![warning])?;
30-
warnings_mod.call_method1(intern!(py, "warn"), args)?;
30+
let args = PyTuple::new(_py, vec![warning])?;
31+
warnings_mod.call_method1(intern!(_py, "warn"), args)?;
3132
}
3233

3334
Ok(())

0 commit comments

Comments
 (0)