aboutsummaryrefslogtreecommitdiff
path: root/src/utils/colour.rs
diff options
context:
space:
mode:
authorZeyla Hellyer <[email protected]>2018-07-15 23:32:50 -0700
committerZeyla Hellyer <[email protected]>2018-07-15 23:33:59 -0700
commit9da766976929417c4b8f487f8ec05b6f8b3f43ef (patch)
tree83cfae143ad7c1c4423d5ac35bf71d6e0bc6b882 /src/utils/colour.rs
parentSupport multiple prefixes for command-groups (#343) (diff)
downloadserenity-9da766976929417c4b8f487f8ec05b6f8b3f43ef.tar.xz
serenity-9da766976929417c4b8f487f8ec05b6f8b3f43ef.zip
Fix some clippy lints
Some lints were not resolved due to causing API changes. Most lints in the framework were left unfixed.
Diffstat (limited to 'src/utils/colour.rs')
-rw-r--r--src/utils/colour.rs12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/utils/colour.rs b/src/utils/colour.rs
index 3b31572..c901e9b 100644
--- a/src/utils/colour.rs
+++ b/src/utils/colour.rs
@@ -133,10 +133,10 @@ impl Colour {
/// assert_eq!(colour.b(), 215);
/// assert_eq!(colour.tuple(), (217, 45, 215));
/// ```
- pub fn from_rgb(r: u8, g: u8, b: u8) -> Colour {
- let mut uint = u32::from(r);
- uint = (uint << 8) | (u32::from(g));
- uint = (uint << 8) | (u32::from(b));
+ pub fn from_rgb(red: u8, green: u8, blue: u8) -> Colour {
+ let mut uint = u32::from(red);
+ uint = (uint << 8) | (u32::from(green));
+ uint = (uint << 8) | (u32::from(blue));
Colour(uint)
}
@@ -241,7 +241,9 @@ impl From<u64> for Colour {
impl From<(u8, u8, u8)> for Colour {
/// Constructs a Colour from rgb.
- fn from((r, g, b): (u8, u8, u8)) -> Self { Colour::from_rgb(r, g, b) }
+ fn from((red, green, blue): (u8, u8, u8)) -> Self {
+ Colour::from_rgb(red, green, blue)
+ }
}
colour! {