Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
mkrasnitski committed Jan 4, 2025
1 parent 452bf82 commit 8409ebc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
26 changes: 13 additions & 13 deletions src/http/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Creates a Guild Scheduled Event.
Expand Down Expand Up @@ -1946,7 +1946,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value::<Member>(value).map_err(From::from)
from_value::<Member>(value)
}

/// Edits a message by Id.
Expand Down Expand Up @@ -2171,7 +2171,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Changes the position of a role in a guild.
Expand Down Expand Up @@ -2209,7 +2209,7 @@ impl Http {
}
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Modifies a scheduled event.
Expand Down Expand Up @@ -2269,7 +2269,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Edits a thread channel in the [`GuildChannel`] given its Id.
Expand Down Expand Up @@ -3750,7 +3750,7 @@ impl Http {
}
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Gets the amount of users that can be pruned.
Expand Down Expand Up @@ -3804,7 +3804,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Retrieves a list of roles in a [`Guild`].
Expand All @@ -3830,7 +3830,7 @@ impl Http {
}
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Gets a scheduled event by Id.
Expand Down Expand Up @@ -3956,7 +3956,7 @@ impl Http {
}
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Retrieves a single sticker in a [`Guild`].
Expand All @@ -3983,7 +3983,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Retrieves the webhooks for the given [guild][`Guild`]'s Id.
Expand Down Expand Up @@ -4120,7 +4120,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Gets information about a specific invite.
Expand Down Expand Up @@ -4185,7 +4185,7 @@ impl Http {
map.insert("guild_id".to_string(), guild_id.get().into());
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Gets a message by an Id, bots only.
Expand Down Expand Up @@ -4736,7 +4736,7 @@ impl Http {
}
}

from_value(value).map_err(From::from)
from_value(value)
}

/// Starts removing some members from a guild based on the last time they've been online.
Expand Down
2 changes: 1 addition & 1 deletion src/internal/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ macro_rules! bitflags {
}
) => {
$(#[$outer])*
#[repr(packed)]
#[repr(Rust, packed)]
$vis struct $BitFlags($T);

bitflags::bitflags! {
Expand Down
2 changes: 1 addition & 1 deletion src/model/colour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Colour {
#[allow(clippy::cast_lossless)]
#[must_use]
pub const fn from_rgb(red: u8, green: u8, blue: u8) -> Colour {
Colour((red as u32) << 16 | (green as u32) << 8 | blue as u32)
Colour(((red as u32) << 16) | ((green as u32) << 8) | blue as u32)
}

/// Returns the red RGB component of this Colour.
Expand Down
4 changes: 2 additions & 2 deletions src/model/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ macro_rules! id_u64 {

/// The inner storage of an ID.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
#[repr(packed)]
#[repr(Rust, packed)]
pub(crate) struct InnerId(NonZeroU64);

struct SnowflakeVisitor;
Expand Down Expand Up @@ -235,7 +235,7 @@ newtype_display_impl!(ShardId, |this| this.0);
/// The specific algorithm used is currently just a sequential index but this is subject to change.
#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq, PartialOrd, Ord, Deserialize, Serialize)]
#[repr(packed)]
#[repr(Rust, packed)]
pub struct AnswerId(u8);

impl AnswerId {
Expand Down
2 changes: 1 addition & 1 deletion src/model/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ pub const PRESET_VOICE: Permissions = Permissions::from_bits_truncate(
/// [`User`]: super::user::User
#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq)]
#[repr(packed)]
#[repr(Rust, packed)]
pub struct Permissions(u64);

generate_permissions! {
Expand Down

0 comments on commit 8409ebc

Please sign in to comment.