Skip to content

Commit

Permalink
refactor imports in tests and doc
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Jun 29, 2022
1 parent fbc6870 commit cfb8c01
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ and `std::path::PathBuf` gains some methods and associated functions
```rust
fn example_path_ext() {
// Trait for extending std::path::Path
use path_slash::PathExt;
use path_slash::PathExt as _;

// On Windows
assert_eq!(
Expand All @@ -48,7 +48,7 @@ fn example_path_ext() {

fn example_pathbuf_ext() {
// Trait for extending std::path::PathBuf
use path_slash::PathBufExt;
use path_slash::PathBufExt as _;

// On Windows
let p = PathBuf::from_slash("foo/bar/piyo.txt");
Expand Down
4 changes: 0 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,5 @@ impl PathBufExt for PathBuf {
}
}

#[cfg(test)]
#[macro_use]
extern crate lazy_static;

#[cfg(test)]
mod test;
5 changes: 3 additions & 2 deletions src/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use super::*;
use super::{PathBufExt as _, PathExt as _};
use lazy_static::lazy_static;
use std::ffi::OsStr;
use std::path;
use std::path::PathBuf;

lazy_static! {
static ref FROM_SLASH_TESTS: Vec<(String, PathBuf)> = {
Expand Down Expand Up @@ -147,7 +149,6 @@ fn from_slash_to_slash() {
#[cfg(target_os = "windows")]
mod windows {
use super::*;
use std::path::PathBuf;

#[test]
fn with_driver_letter_to_slash() {
Expand Down

0 comments on commit cfb8c01

Please sign in to comment.