diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2022-08-27 20:50:05 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-27 20:50:05 +0530 |
commit | 8e1c0e5141fa93f9169c28f32093bb7b30cd4e05 (patch) | |
tree | 7525a6717f1fff55d3356d99657aa593148f0eb1 /core/normalize_path.rs | |
parent | 19fb9abe334313bec9f885818ed82ae754dd84e2 (diff) |
perf(runtime): optimize allocations in read/write checks (#15631)
Diffstat (limited to 'core/normalize_path.rs')
-rw-r--r-- | core/normalize_path.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/normalize_path.rs b/core/normalize_path.rs index 150f30b59..a295b55e6 100644 --- a/core/normalize_path.rs +++ b/core/normalize_path.rs @@ -9,6 +9,7 @@ use std::path::PathBuf; /// /// Taken from Cargo /// <https://github.com/rust-lang/cargo/blob/af307a38c20a753ec60f0ad18be5abed3db3c9ac/src/cargo/util/paths.rs#L60-L85> +#[inline] pub fn normalize_path<P: AsRef<Path>>(path: P) -> PathBuf { let mut components = path.as_ref().components().peekable(); let mut ret = |