Skip to content

Commit

Permalink
refactor: clippy::must_use_candidate
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Aug 17, 2024
1 parent 6d78e15 commit 59dffae
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ struct_excessive_bools = "allow" # due to Telegram API

# TODO: remove and fix (or allow explicitly on the specific problem)
missing_errors_doc = "allow"
must_use_candidate = "allow"
option_if_let_else = "allow"
significant_drop_tightening = "allow"
single_match_else = "allow"
Expand Down
1 change: 1 addition & 0 deletions src/api/async_telegram_api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use tokio::fs::File;
use typed_builder::TypedBuilder;

#[derive(Debug, Clone, TypedBuilder)]
#[must_use = "API needs to be used in order to be useful"]
pub struct AsyncApi {
#[builder(setter(into))]
pub api_url: String,
Expand Down
2 changes: 1 addition & 1 deletion src/api/telegram_api_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use typed_builder::TypedBuilder;
use ureq::Response;

#[derive(Debug, Clone, TypedBuilder)]
#[must_use = "API needs to be used in order to be useful"]
pub struct Api {
#[builder(setter(into))]
pub api_url: String,
Expand All @@ -20,7 +21,6 @@ impl Api {
/// Create a new `Api`. You can use `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()
}

Expand Down
1 change: 1 addition & 0 deletions src/parse_mode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ impl FromStr for ParseMode {
}

impl ParseMode {
#[must_use]
pub const fn to_str(self) -> &'static str {
match self {
Self::Html => "HTML",
Expand Down

0 comments on commit 59dffae

Please sign in to comment.