diff --git a/src/api/async_telegram_api_impl.rs b/src/api/async_telegram_api_impl.rs index a999605..501df7f 100644 --- a/src/api/async_telegram_api_impl.rs +++ b/src/api/async_telegram_api_impl.rs @@ -22,13 +22,12 @@ pub struct AsyncApi { } impl AsyncApi { - /// Create a new `AsyncApi`. You can use `AsyncApi::builder()` for more options. + /// Create a new `AsyncApi`. You can use [`AsyncApi::new_url`] or [`AsyncApi::builder`] for more options. pub fn new(api_key: &str) -> Self { - let api_url = format!("{}{api_key}", super::BASE_API_URL); - Self::builder().api_url(api_url).build() + Self::new_url(format!("{}{api_key}", super::BASE_API_URL)) } - /// Create a new `AsyncApi`. You can use `AsyncApi::builder()` for more options. + /// Create a new `AsyncApi`. You can use [`AsyncApi::builder`] for more options. pub fn new_url>(api_url: T) -> Self { Self::builder().api_url(api_url).build() } diff --git a/src/api/telegram_api_impl.rs b/src/api/telegram_api_impl.rs index 304a110..a1c2151 100644 --- a/src/api/telegram_api_impl.rs +++ b/src/api/telegram_api_impl.rs @@ -18,13 +18,12 @@ pub struct Api { } impl Api { - /// Create a new `Api`. You can use `Api::builder()` for more options. + /// Create a new `Api`. You can use [`Api::new_url`] or [`Api::builder`] for more options. pub fn new(api_key: &str) -> Self { - let api_url = format!("{}{api_key}", super::BASE_API_URL); - Self::builder().api_url(api_url).build() + Self::new_url(format!("{}{api_key}", super::BASE_API_URL)) } - /// Create a new `Api`. You can use `Api::builder()` for more options. + /// Create a new `Api`. You can use [`Api::builder`] for more options. pub fn new_url>(api_url: T) -> Self { Self::builder().api_url(api_url).build() }