have compose_post use a string reference instead of `String`

This commit is contained in:
Mahesh Bansod 2021-10-30 16:48:11 +05:30
parent bebe57ac8e
commit 72c5a8976b
1 changed files with 5 additions and 2 deletions

View File

@ -272,13 +272,16 @@ impl Client {
/// attachments: A vector of Document IDs to attach to the post
pub async fn compose_post(
&self,
text: String,
text: &str,
attachments: Vec<String>,
) -> Result<Post, SocialvoidError> {
match self.current_session {
Some(session_key) => {
let sesh_id = self.sessions[session_key].session_identification()?;
Ok(timeline::compose(&self.rpc_client, sesh_id, text, attachments).await?)
Ok(
timeline::compose(&self.rpc_client, sesh_id, text.to_string(), attachments)
.await?,
)
}
None => Err(SocialvoidError::Client(ClientError::NoSessionsExist)),
}