Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
jtk18 committed Jun 7, 2022
1 parent 6cafd8a commit 9d2664d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["Jason Kiniry <[email protected]>"]
name = "pathext"
version = "0.1.5"
version = "0.1.6"
edition = "2021"
license = "MIT OR Apache-2.0"
homepage = "https://github.com/jtk18/pathext"
Expand Down
8 changes: 5 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ pub trait PathExt {
/// I think this is the only implementation needed since there is a lot that implements AsRef<Path> in std.
impl<T: AsRef<Path>> PathExt for T {
fn contains(&self, pattern: &str) -> bool {
self.as_ref().to_str().map_or(false, |s| s.contains(pattern))
self.as_ref()
.to_str()
.map_or(false, |s| s.contains(pattern))
}

fn has_component(&self, component: &str) -> bool {
Expand Down Expand Up @@ -202,8 +204,8 @@ mod tests {
vec![
("/usr/local", "aardvark"),
("/usr/", "local/aardvark"),
("/repos/local/", "/usr/local/aardvark")
]
("/repos/local/", "/usr/local/aardvark"),
],
)];

for test_case in tests {
Expand Down

0 comments on commit 9d2664d

Please sign in to comment.