diff --git a/services/comm-services-lib/src/blob/client.rs b/services/comm-services-lib/src/blob/client.rs --- a/services/comm-services-lib/src/blob/client.rs +++ b/services/comm-services-lib/src/blob/client.rs @@ -71,14 +71,18 @@ /// - [BlobServiceError::InvalidArguments] if blob hash has incorrect format /// /// # Example - /// ```rust + /// ```no_run + /// # use comm_services_lib::blob::client::BlobServiceClient; + /// # use futures_util::stream::TryStreamExt; + /// # async fn f() { /// let client = - /// BlobServiceClient::new("http://localhost:50053".parse()?); + /// BlobServiceClient::new("http://localhost:50053".parse().unwrap()); /// - /// let mut stream = client.get("hello").await?; - /// while let Some(data) = stream.try_next().await? { + /// let mut stream = client.get("hello").await.unwrap(); + /// while let Some(data) = stream.try_next().await.unwrap() { /// println!("Got data: {:?}", data); /// } + /// # } /// ``` pub async fn get( &self, @@ -181,18 +185,22 @@ /// already exists. /// /// # Example - /// ```rust + /// ```no_run + /// # use comm_services_lib::blob::client::BlobServiceClient; + /// # use async_stream; + /// # async fn f(blob_hash: String) { /// use std::io::{Error, ErrorKind}; - /// /// let client = - /// BlobServiceClient::new("http://localhost:50053".parse()?); + /// BlobServiceClient::new("http://localhost:50053".parse().unwrap()); /// /// let stream = async_stream::stream! { /// yield Ok(vec![1, 2, 3]); /// yield Ok(vec![4, 5, 6]); /// yield Err(Error::new(ErrorKind::Other, "Oops")); /// }; - /// client.upload_blob(&blob_hash, stream).await?; + /// + /// client.upload_blob(&blob_hash, stream).await.unwrap(); + /// # } /// ``` pub async fn upload_blob( &self, diff --git a/services/comm-services-lib/src/database.rs b/services/comm-services-lib/src/database.rs --- a/services/comm-services-lib/src/database.rs +++ b/services/comm-services-lib/src/database.rs @@ -66,13 +66,14 @@ /// Conversion trait for [`AttributeValue`] /// /// Types implementing this trait are able to do the following: -/// ```rust +/// ``` /// use comm_services_lib::database::{TryFromAttribute, AttributeTryInto}; -/// -/// let foo = SomeType::try_from_attr("MyAttribute", Some(attribute)); +/// # let attribute = aws_sdk_dynamodb::types::AttributeValue::S("a".to_string()); +/// let foo = String::try_from_attr("MyAttribute", Some(attribute)).unwrap(); /// /// // if `AttributeTryInto` is imported, also: -/// let bar = Some(attribute).attr_try_into("MyAttribute"); +/// # let attribute = aws_sdk_dynamodb::types::AttributeValue::S("a".to_string()); +/// let bar: String = Some(attribute).attr_try_into("MyAttribute").unwrap(); pub trait TryFromAttribute: Sized { fn try_from_attr( attribute_name: impl Into,