From 346095d20e3d817d150cbea49e87a49fbcaa2304 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 7 Feb 2025 14:08:20 +0100 Subject: nodeid guard --- client/src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'client/src/lib.rs') diff --git a/client/src/lib.rs b/client/src/lib.rs index 5da718d..e0ab440 100644 --- a/client/src/lib.rs +++ b/client/src/lib.rs @@ -71,8 +71,8 @@ impl Session { format!("session={}", self.session_token) } - pub async fn node(&self, id: &str) -> Result { - debug!("downloading node {id:?}"); + pub async fn node(&self, id: NodeIDOrSlug) -> Result { + debug!("downloading node {id}"); Ok(self .client .get(format!("{}/n/{id}", self.instance.base())) @@ -86,11 +86,11 @@ impl Session { pub async fn node_thumbnail( &self, writer: impl UnpinWrite, - id: &str, + id: NodeIDOrSlug, width: usize, time: f64, ) -> Result<()> { - debug!("downloading thumbnail for {id:?} at {time}s"); + debug!("downloading thumbnail for {id} at {time}s"); self.download_url( writer, format!( @@ -113,14 +113,14 @@ impl Session { pub async fn stream( &self, writer: impl UnpinWrite, - id: &str, + id: NodeIDOrSlug, stream_spec: &StreamSpec, ) -> Result<()> { self.download_url(writer, self.stream_url(id, stream_spec)) .await } - pub fn stream_url(&self, id: &str, stream_spec: &StreamSpec) -> String { + pub fn stream_url(&self, id: NodeIDOrSlug, stream_spec: &StreamSpec) -> String { format!( "{}/n/{}/stream?{}&{}", self.instance.base(), -- cgit v1.2.3-70-g09d2