Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fastn_ds Fix: fastn_ds::Path strip_prefix function #1679

Merged
merged 3 commits into from
Jan 4, 2024
Merged

Conversation

Arpita-Jaiswal
Copy link
Contributor

@Arpita-Jaiswal Arpita-Jaiswal commented Jan 4, 2024

This PR has following changes:

Change the signature of fastn_ds::Path::strip_prefix function from:

pub fn strip_prefix(&self, base: &Self) -> fastn_ds::Path

to

pub fn strip_prefix(&self, base: &Self) -> Option<fastn_ds::Path> 

Move fastn_ds::Path::exists to fastn_ds::DocumentStore::exists

- impl fastn_ds::Path {
-    pub fn exists(&self) -> bool {
-       self.path.exists()
-    }
- }

+ impl fastn_ds::DocumentStore {
+    pub fn exists(&self, path: &fastn_ds::Path) -> bool {
+        path.path.exists()
+    }
+ }

amitu
amitu previously approved these changes Jan 4, 2024
@amitu amitu merged commit 4421c50 into main Jan 4, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants