From 42f14e72d08a77047e7595c437aac0d425fdd59b Mon Sep 17 00:00:00 2001 From: Orual Date: Fri, 3 Oct 2025 21:37:09 -0400 Subject: [PATCH] renamed UriPath to RepoPath for clarity --- crates/jacquard-common/src/types/aturi.rs | 38 +++++++++---------- .../jacquard-common/src/types/collection.rs | 6 +-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/crates/jacquard-common/src/types/aturi.rs b/crates/jacquard-common/src/types/aturi.rs index 30b14e3..6433420 100644 --- a/crates/jacquard-common/src/types/aturi.rs +++ b/crates/jacquard-common/src/types/aturi.rs @@ -31,7 +31,7 @@ struct Inner<'u> { pub authority: AtIdentifier<'this>, #[borrows(uri)] #[covariant] - pub path: Option>, + pub path: Option>, #[borrows(uri)] #[covariant] pub fragment: Option>, @@ -58,7 +58,7 @@ impl Clone for AtUri<'_> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None } @@ -83,23 +83,23 @@ impl Hash for AtUri<'_> { /// at:// URI path component (current subset) #[derive(Clone, PartialEq, Eq, Hash, Debug)] -pub struct UriPath<'u> { +pub struct RepoPath<'u> { pub collection: Nsid<'u>, pub rkey: Option>>, } -impl IntoStatic for UriPath<'_> { - type Output = UriPath<'static>; +impl IntoStatic for RepoPath<'_> { + type Output = RepoPath<'static>; fn into_static(self) -> Self::Output { - UriPath { + RepoPath { collection: self.collection.into_static(), rkey: self.rkey.map(|rkey| rkey.into_static()), } } } -pub type UriPathBuf = UriPath<'static>; +pub type UriPathBuf = RepoPath<'static>; pub static ATURI_REGEX: LazyLock = LazyLock::new(|| { // Fragment allows: / and \ and other special chars. In raw string, backslashes are literal. @@ -125,7 +125,7 @@ impl<'u> AtUri<'u> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None }; @@ -166,7 +166,7 @@ impl<'u> AtUri<'u> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None }; @@ -207,7 +207,7 @@ impl<'u> AtUri<'u> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None }; @@ -286,7 +286,7 @@ impl<'u> AtUri<'u> { self.inner.borrow_authority() } - pub fn path(&self) -> &Option> { + pub fn path(&self) -> &Option> { self.inner.borrow_path() } @@ -339,7 +339,7 @@ impl AtUri<'static> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None }; @@ -367,7 +367,7 @@ impl AtUri<'static> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None } @@ -418,7 +418,7 @@ impl AtUri<'static> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None }; @@ -470,7 +470,7 @@ impl FromStr for AtUri<'_> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None }; @@ -498,7 +498,7 @@ impl FromStr for AtUri<'_> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None } @@ -555,7 +555,7 @@ impl IntoStatic for AtUri<'_> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None } @@ -646,7 +646,7 @@ impl<'d> TryFrom> for AtUri<'d> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None }; @@ -672,7 +672,7 @@ impl<'d> TryFrom> for AtUri<'d> { } else { None }; - Some(UriPath { collection, rkey }) + Some(RepoPath { collection, rkey }) } else { None } diff --git a/crates/jacquard-common/src/types/collection.rs b/crates/jacquard-common/src/types/collection.rs index ef9fdec..63df394 100644 --- a/crates/jacquard-common/src/types/collection.rs +++ b/crates/jacquard-common/src/types/collection.rs @@ -3,7 +3,7 @@ use core::fmt; use serde::Serialize; use crate::types::{ - aturi::UriPath, + aturi::RepoPath, nsid::Nsid, recordkey::{RecordKey, RecordKeyType, Rkey}, }; @@ -42,8 +42,8 @@ pub trait Collection: fmt::Debug + Serialize { /// [`Nsid`]: crate::types::string::Nsid fn repo_path<'u, T: RecordKeyType>( rkey: &'u crate::types::recordkey::RecordKey, - ) -> UriPath<'u> { - UriPath { + ) -> RepoPath<'u> { + RepoPath { collection: Self::nsid(), rkey: Some(RecordKey::from(Rkey::raw(rkey.as_ref()))), } -- 2.51.2