Fix: Conditional compiling errors and warnings

This commit is contained in:
bitfl0wer 2024-08-21 19:09:57 +02:00
parent 4921487b33
commit 859f3be213
No known key found for this signature in database
GPG Key ID: 8D90CA11485CD14D
5 changed files with 9 additions and 5 deletions

View File

@ -16,6 +16,7 @@ use crate::types::{
}; };
impl Message { impl Message {
#[allow(clippy::useless_conversion)]
/// Sends a message in the channel with the provided channel_id. /// Sends a message in the channel with the provided channel_id.
/// Returns the sent message. /// Returns the sent message.
/// ///

View File

@ -101,8 +101,7 @@ This crate uses Semantic Versioning 2.0.0 as its versioning scheme. You can read
clippy::extra_unused_lifetimes, clippy::extra_unused_lifetimes,
clippy::from_over_into, clippy::from_over_into,
clippy::needless_borrow, clippy::needless_borrow,
clippy::new_without_default, clippy::new_without_default
clippy::useless_conversion
)] )]
#![warn( #![warn(
clippy::todo, clippy::todo,
@ -111,7 +110,8 @@ This crate uses Semantic Versioning 2.0.0 as its versioning scheme. You can read
clippy::print_stdout, clippy::print_stdout,
clippy::print_stderr, clippy::print_stderr,
missing_debug_implementations, missing_debug_implementations,
missing_copy_implementations missing_copy_implementations,
clippy::useless_conversion
)] )]
#[cfg(all(feature = "rt", feature = "rt_multi_thread"))] #[cfg(all(feature = "rt", feature = "rt_multi_thread"))]
compile_error!("feature \"rt\" and feature \"rt_multi_thread\" cannot be enabled at the same time"); compile_error!("feature \"rt\" and feature \"rt_multi_thread\" cannot be enabled at the same time");

View File

@ -83,6 +83,7 @@ pub struct AutoModerationRuleTriggerMetadataForKeywordPreset {
pub allow_list: Vec<String>, pub allow_list: Vec<String>,
} }
#[allow(missing_copy_implementations)]
#[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, PartialOrd, Ord)] #[derive(Serialize, Deserialize, Debug, Clone, Default, PartialEq, Eq, PartialOrd, Ord)]
/// See <https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata> /// See <https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata>
pub struct AutoModerationRuleTriggerMetadataForMentionSpam { pub struct AutoModerationRuleTriggerMetadataForMentionSpam {

View File

@ -25,7 +25,8 @@ impl Default for SecurityKey {
user_id: String::new(), user_id: String::new(),
key_id: String::new(), key_id: String::new(),
public_key: String::new(), public_key: String::new(),
counter: 0.into(), #[allow(clippy::useless_conversion)]
counter: 0u64.into(),
name: String::new(), name: String::new(),
} }
} }

View File

@ -80,7 +80,8 @@ pub struct UserSettings {
impl Default for UserSettings { impl Default for UserSettings {
fn default() -> Self { fn default() -> Self {
Self { Self {
afk_timeout: Some(3600.into()), #[allow(clippy::useless_conversion)]
afk_timeout: Some(3600u16.into()),
allow_accessibility_detection: true, allow_accessibility_detection: true,
animate_emoji: true, animate_emoji: true,
#[cfg(not(feature = "sqlx"))] #[cfg(not(feature = "sqlx"))]