···290290/// ```
291291pub trait XrpcExt: HttpClient {
292292 /// Start building an XRPC call for the given base URI.
293293- fn xrpc<'a>(&'a self, base: Uri<String>) -> XrpcCall<'a, Self>
293293+ fn xrpc<'a>(&'a self, base: Uri<&'a str>) -> XrpcCall<'a, Self>
294294 where
295295 Self: Sized,
296296 {
···454454/// ```
455455pub struct XrpcCall<'a, C: HttpClient> {
456456 pub(crate) client: &'a C,
457457- pub(crate) base: Uri<String>,
457457+ pub(crate) base: Uri<&'a str>,
458458 pub(crate) opts: CallOptions<'a>,
459459}
460460···578578/// 3. Builds new path: `{base_path}/xrpc/{nsid}`
579579/// 4. Optionally sets query from serialized parameters
580580/// 5. Returns the constructed URI
581581-fn xrpc_endpoint_uri(
582582- base: &Uri<String>,
583583- nsid: &str,
584584- query: Option<&str>,
585585-) -> XrpcResult<Uri<String>> {
581581+fn xrpc_endpoint_uri(base: &Uri<&str>, nsid: &str, query: Option<&str>) -> XrpcResult<Uri<String>> {
586582 use crate::error::ClientError;
587583588584 let base_path = base.path().as_str().trim_end_matches('/');
···615611 }
616612617613 Uri::parse(uri_str)
618618- .map(|u| u.to_owned())
619614 .map_err(|_| ClientError::invalid_request("Failed to construct XRPC endpoint URI"))
620615}
621616622617/// Build an HTTP request for an XRPC call given base URI and options
623618pub fn build_http_request<'s, R>(
624624- base: &Uri<String>,
619619+ base: &Uri<&str>,
625620 req: &R,
626621 opts: &CallOptions<'_>,
627622) -> XrpcResult<Request<Vec<u8>>>
···12071202 let opts = CallOptions::default();
1208120312091204 // AC1.1: Base URI without trailing slash + NSID produces correct `/xrpc/{nsid}` path
12101210- let base1 = Uri::parse("https://pds.example.com")
12111211- .expect("URI should be valid")
12121212- .to_owned();
12051205+ let base1 = Uri::parse("https://pds.example.com").expect("URI should be valid");
12131206 let req1 = build_http_request(&base1, &Req, &opts).unwrap();
12141207 let uri1 = req1.uri().to_string();
12151208 assert!(
···12231216 );
1224121712251218 // AC1.2: Base URI with sub-path preserves it: `/base/xrpc/{nsid}`
12261226- let base2 = Uri::parse("https://pds.example.com/base")
12271227- .expect("URI should be valid")
12281228- .to_owned();
12191219+ let base2 = Uri::parse("https://pds.example.com/base").expect("URI should be valid");
12291220 let req2 = build_http_request(&base2, &Req, &opts).unwrap();
12301221 let uri2 = req2.uri().to_string();
12311222 assert!(
···12391230 );
1240123112411232 // AC1.5: Base URI with trailing slash is normalized (slash stripped) before construction
12421242- let base_with_slash = Uri::parse("https://pds.example.com/")
12431243- .expect("URI should be valid")
12441244- .to_owned();
12331233+ let base_with_slash = Uri::parse("https://pds.example.com/").expect("URI should be valid");
12451234 let req_slash = build_http_request(&base_with_slash, &Req, &opts).unwrap();
12461235 let uri_slash = req_slash.uri().to_string();
12471236 assert!(
···12851274 }
1286127512871276 let opts = CallOptions::default();
12881288- let base = Uri::parse("https://pds.example.com")
12891289- .expect("URI should be valid")
12901290- .to_owned();
12771277+ let base = Uri::parse("https://pds.example.com").expect("URI should be valid");
1291127812921279 // AC1.3: Query parameters from serde serialisation are set correctly
12931280 let req_with_params = QueryReq {
···13591346 }
1360134713611348 let opts = CallOptions::default();
13621362- let base = Uri::parse("https://pds.example.com")
13631363- .expect("URI should be valid")
13641364- .to_owned();
13491349+ let base = Uri::parse("https://pds.example.com").expect("URI should be valid");
1365135013661351 // AC1.3: Test with spaces (serde_html_form uses + for spaces per application/x-www-form-urlencoded)
13671352 let req_spaces = QueryReq {
···14471432 let opts = CallOptions::default();
1448143314491434 // Ensure no double slashes in path
14501450- let base1 = Uri::parse("https://pds")
14511451- .expect("URI should be valid")
14521452- .to_owned();
14351435+ let base1 = Uri::parse("https://pds").expect("URI should be valid");
14531436 let req1 = build_http_request(&base1, &Req, &opts).unwrap();
14541437 let uri1 = req1.uri().to_string();
14551438 assert!(
···14581441 uri1
14591442 );
1460144314611461- let base2 = Uri::parse("https://pds/base")
14621462- .expect("URI should be valid")
14631463- .to_owned();
14441444+ let base2 = Uri::parse("https://pds/base").expect("URI should be valid");
14641445 let req2 = build_http_request(&base2, &Req, &opts).unwrap();
14651446 let uri2 = req2.uri().to_string();
14661447 assert!(