client: Use .to_owned() instead of .parse().unwrap()

… for &str to String conversion in examples.
This commit is contained in:
Jonas Platte 2024-01-18 13:37:16 +01:00
parent 9d81576af7
commit 684ffc7898
2 changed files with 4 additions and 4 deletions

View File

@ -183,7 +183,7 @@ impl<C: HttpClient> Client<C> {
///
/// # use ruma_common::presence::PresenceState;
/// # use tokio_stream::{StreamExt as _};
/// # let homeserver_url = "https://example.com".parse().unwrap();
/// # let homeserver_url = "https://example.com".to_owned();
/// # async {
/// # let client = ruma_client::Client::builder()
/// # .homeserver_url(homeserver_url)

View File

@ -13,7 +13,7 @@
//! // type HttpClient = ruma_client::http_client::_;
//! # type HttpClient = ruma_client::http_client::Dummy;
//! # let work = async {
//! let homeserver_url = "https://example.com".parse().unwrap();
//! let homeserver_url = "https://example.com".to_owned();
//! let client = ruma::Client::builder()
//! .homeserver_url(homeserver_url)
//! .build::<ruma_client::http_client::Dummy>()
@ -37,7 +37,7 @@
//! # type HttpClient = ruma_client::http_client::Dummy;
//! #
//! # async {
//! let homeserver_url = "https://example.com".parse().unwrap();
//! let homeserver_url = "https://example.com".to_owned();
//! let client = ruma_client::Client::builder()
//! .homeserver_url(homeserver_url)
//! .access_token(Some("as_access_token".into()))
@ -59,7 +59,7 @@
//! For example:
//!
//! ```no_run
//! # let homeserver_url = "https://example.com".parse().unwrap();
//! # let homeserver_url = "https://example.com".to_owned();
//! # async {
//! # let client = ruma_client::Client::builder()
//! # .homeserver_url(homeserver_url)