strip_prefix() — tailwindcss Function Reference
Architecture documentation for the strip_prefix() function in pathutil.rs from the tailwindcss codebase.
Entity Profile
Dependency Diagram
graph TD cc233b01_55d4_2920_9871_58c2eb474cce["strip_prefix()"] 14fdbab7_73ef_0246_2884_5f8133abec90["pathutil.rs"] cc233b01_55d4_2920_9871_58c2eb474cce -->|defined in| 14fdbab7_73ef_0246_2884_5f8133abec90 style cc233b01_55d4_2920_9871_58c2eb474cce fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
crates/ignore/src/pathutil.rs lines 63–76
pub(crate) fn strip_prefix<'a, P: AsRef<Path> + ?Sized>(
prefix: &'a P,
path: &'a Path,
) -> Option<&'a Path> {
use std::os::unix::ffi::OsStrExt;
let prefix = prefix.as_ref().as_os_str().as_bytes();
let path = path.as_os_str().as_bytes();
if prefix.len() > path.len() || prefix != &path[0..prefix.len()] {
None
} else {
Some(&Path::new(OsStr::from_bytes(&path[prefix.len()..])))
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does strip_prefix() do?
strip_prefix() is a function in the tailwindcss codebase, defined in crates/ignore/src/pathutil.rs.
Where is strip_prefix() defined?
strip_prefix() is defined in crates/ignore/src/pathutil.rs at line 63.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free