From 10ee2acdd26a7f1298c6f6d6b7af9b469fe29b87 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 4 May 2024 14:41:41 +0200 Subject: Merging upstream version 1.70.0+dfsg2. Signed-off-by: Daniel Baumann --- vendor/gix-path/src/util.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 vendor/gix-path/src/util.rs (limited to 'vendor/gix-path/src/util.rs') diff --git a/vendor/gix-path/src/util.rs b/vendor/gix-path/src/util.rs new file mode 100644 index 000000000..7920910d7 --- /dev/null +++ b/vendor/gix-path/src/util.rs @@ -0,0 +1,8 @@ +use std::path::Path; + +/// return true if `path` is absolute, which depends on the platform but is always true if it starts with a `slash`, hence looks like +/// a linux path. +pub fn is_absolute(path: impl AsRef) -> bool { + let path = path.as_ref(); + path.is_absolute() || path.to_str().and_then(|s| s.chars().next()) == Some('/') +} -- cgit v1.2.3