Skip to content

Commit

Permalink
Fix unused imports on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kangalio committed Jan 10, 2021
1 parent 79915f3 commit 9586c8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/types/osstr.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use crate::types::PyString;
#[cfg(not(windows))]
use crate::PyNativeType;
use crate::{
ffi, AsPyPointer, FromPyObject, IntoPy, PyAny, PyNativeType, PyObject, PyResult, PyTryFrom,
Python, ToPyObject,
ffi, AsPyPointer, FromPyObject, IntoPy, PyAny, PyObject, PyResult, PyTryFrom, Python,
ToPyObject,
};
use std::borrow::Cow;
use std::ffi::{OsStr, OsString};
#[cfg(not(windows))]
use std::os::raw::c_char;

impl ToPyObject for OsStr {
Expand Down Expand Up @@ -178,7 +181,7 @@ mod test {

// do a roundtrip into Pythonland and back and compare
let py_str = os_str.into_py(py);
let os_str_2: &OsStr = py_str.extract(py).unwrap();
let os_str_2: OsString = py_str.extract(py).unwrap();
assert_eq!(os_str, os_str_2);
})
}
Expand Down
4 changes: 3 additions & 1 deletion src/types/path.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use crate::{FromPyObject, IntoPy, PyAny, PyObject, PyResult, Python, ToPyObject};
use std::borrow::Cow;
use std::ffi::{OsStr, OsString};
#[cfg(not(windows))]
use std::ffi::OsStr;
use std::ffi::OsString;
use std::path::{Path, PathBuf};

impl ToPyObject for Path {
Expand Down

0 comments on commit 9586c8a

Please sign in to comment.