Skip to content

WilliamVenner/fuzzypath

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

crates.io

docs.rs

🧹 fuzzypath

Quick & dirty fuzzy path comparison

Comparison rules

  • ✅ Case insensitive
  • ✅ Backslashes are normalized to forward slashes
  • ✅ Trailing slashes are removed, except for root slash (for absolute POSIX paths)
  • ✅ Repeating slashes are normalized to a single slash
  • ❌ Comparing a Windows path with a POSIX path will not work if either is absolute (Windows paths with a drive letter, POSIX paths with a preceeding slash)
  • ❌ Comparing a Windows UNC path will not work with any POSIX path
  • ❌ POSIX paths can contain backslashes in file names, but Windows paths cannot - these will be normalized to forward slashes and you will lose that information

Usage

Add fuzzypath to your Cargo.toml dependencies:

[dependencies]
fuzzypath = "1"

Serde

To enable Serde serialization and deserialization, use the crate feature serde

[dependencies]
fuzzypath = { version = "1", features = ["serde"] }