make new function inline

This commit is contained in:
Shupeng Xue 2024-06-23 16:32:36 +10:00
parent e86eeb5c16
commit 536a928ff0
No known key found for this signature in database
GPG key ID: A6C508165D76B601

View file

@ -35,6 +35,7 @@ pub async fn are_paths_equal(old: impl AsRef<Path>, new: impl AsRef<Path>) -> bo
}
}
#[inline]
async fn canonicalize_without_resolving_itself(path: impl AsRef<Path>) -> Option<PathBuf> {
let meta = fs::symlink_metadata(&path).await.ok()?;
if meta.is_symlink() {