Skip to content

Commit

Permalink
rust: add path: is_absolute
Browse files Browse the repository at this point in the history
This adds thew new API call that was added last night.

Signed-off-by: Sean Cross <[email protected]>
  • Loading branch information
xobs committed Jan 16, 2025
1 parent 3a0b800 commit 08c705b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions 0002-std-xous-add-support-for-path.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
From ec265421f0119b78cc11eb5c16ce7babfe37776b Mon Sep 17 00:00:00 2001
From e32a8e960c786a1070255f99e765ba53e994d559 Mon Sep 17 00:00:00 2001
From: Sean Cross <[email protected]>
Date: Tue, 6 Aug 2024 22:45:31 +0800
Subject: [PATCH 2/5] std: xous: add support for path
Subject: [PATCH 2/4] std: xous: add support for path

Add support for the Xous-specific path implementation.

Signed-off-by: Sean Cross <[email protected]>
---
library/std/src/sys/path/mod.rs | 3 ++
library/std/src/sys/path/xous.rs | 72 ++++++++++++++++++++++++++++++++
2 files changed, 75 insertions(+)
library/std/src/sys/path/xous.rs | 76 ++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+)
create mode 100644 library/std/src/sys/path/xous.rs

diff --git a/library/std/src/sys/path/mod.rs b/library/std/src/sys/path/mod.rs
Expand All @@ -28,10 +28,10 @@ index 24a94ec7828..c501416f718 100644
pub use unix::*;
diff --git a/library/std/src/sys/path/xous.rs b/library/std/src/sys/path/xous.rs
new file mode 100644
index 00000000000..262bfe5985c
index 00000000000..c1f6359b117
--- /dev/null
+++ b/library/std/src/sys/path/xous.rs
@@ -0,0 +1,72 @@
@@ -0,0 +1,76 @@
+use crate::ffi::OsStr;
+use crate::io;
+use crate::path::{Path, PathBuf, Prefix};
Expand Down Expand Up @@ -59,6 +59,10 @@ index 00000000000..262bfe5985c
+ Ok(path.to_owned())
+}
+
+pub(crate) fn is_absolute(path: &Path) -> bool {
+ path.has_root() && path.prefix().is_some()
+}
+
+/// Split a path into its constituant Basis and Dict, if the path is legal.
+pub(crate) fn split_basis_and_dict<'a, F: Fn() -> Option<&'a str>>(
+ src: &'a str,
Expand Down
2 changes: 1 addition & 1 deletion rust
Submodule rust updated 6957 files

0 comments on commit 08c705b

Please sign in to comment.