Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
dylni committed Feb 17, 2024
1 parent dce52c9 commit 7c4daf3
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ rustdoc-args = ["--cfg", "normpath_docs_rs"]
[dependencies]
print_bytes = { version = "2.0", features = ["os_str_bytes"], optional = true }
serde = { version = "1.0", optional = true }
uniquote = { version = "3.2", optional = true }
uniquote = { version = "3.0", optional = true }

[target.'cfg(windows)'.dependencies]
windows-sys = { version = "0.52", features = ["Win32_Storage_FileSystem"] }

[dev-dependencies]
bincode = "1.3"
tempfile = "3.2"
bincode = "1.0"
tempfile = "3.0"

[target.'cfg(windows)'.dev-dependencies]
windows-sys = { version = "0.52", features = ["Win32_Foundation"] }
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Windows: [#45067], [#48249], [#52440], [#55812], [#58613], [#59107], [#74327].
Normalization is usually a better choice unless you specifically need a
canonical path.

[![GitHub Build Status](https://github.com/dylni/normpath/workflows/build/badge.svg?branch=master)](https://github.com/dylni/normpath/actions?query=branch%3Amaster)
[![GitHub Build Status](https://github.com/dylni/normpath/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/dylni/normpath/actions/workflows/build.yml?query=branch%3Amaster)

## Usage

Expand Down
2 changes: 1 addition & 1 deletion src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ impl BasePathBuf {
impl AsRef<OsStr> for BasePathBuf {
#[inline]
fn as_ref(&self) -> &OsStr {
self.0.as_os_str()
self.as_os_str()
}
}

Expand Down
2 changes: 0 additions & 2 deletions src/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
//! The error types defined by this crate.

#![allow(clippy::derive_partial_eq_without_eq)]

use std::error::Error;
use std::fmt;
use std::fmt::Display;
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! - **localization** -
//! Provides [`PathExt::localize_name`] and [`BasePath::localize_name`].
//!
//! - **print_bytes** -
//! - **print\_bytes** -
//! Provides implementations of [`print_bytes::ToBytes`] for [`BasePath`] and
//! [`BasePathBuf`].
//!
Expand Down
7 changes: 6 additions & 1 deletion src/windows/normalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ fn normalize_verbatim(path: &Path) -> BasePathBuf {
*ch = SEPARATOR;
}
}
BasePathBuf(OsString::from_wide(&path).into())
let path: PathBuf = OsString::from_wide(&path).into();
debug_assert!(matches!(
path.components().next(),
Some(Component::Prefix(prefix)) if prefix.kind().is_verbatim(),
));
BasePathBuf(path)
}

pub(super) fn normalize_virtually(
Expand Down

0 comments on commit 7c4daf3

Please sign in to comment.