mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-17 07:18:04 +08:00
Remove warnings from build and satisfied clippy (#1288)
* Prefixed unused functions with underscore * Applied clippy lints * Fixed some warnings and removed some `allow` statements
This commit is contained in:
committed by
Keavon Chambers
parent
054acd3cc9
commit
70fcb35444
@@ -1,6 +1,6 @@
|
||||
#![allow(clippy::too_many_arguments)]
|
||||
use super::Color;
|
||||
use crate::Node;
|
||||
|
||||
use core::fmt::Debug;
|
||||
use dyn_any::{DynAny, StaticType};
|
||||
#[cfg(feature = "serde")]
|
||||
@@ -195,7 +195,7 @@ fn extract_channel_node(color: Color, channel: RedGreenBlue) -> Color {
|
||||
RedGreenBlue::Green => color.g(),
|
||||
RedGreenBlue::Blue => color.b(),
|
||||
};
|
||||
return color.map_rgb(|_| extracted_value);
|
||||
color.map_rgb(|_| extracted_value)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, Default)]
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#![allow(clippy::neg_cmp_op_on_partial_ord)]
|
||||
//! Fast conversions between u8 sRGB and linear float.
|
||||
|
||||
// Inspired by https://gist.github.com/rygorous/2203834, but with a slightly
|
||||
|
||||
@@ -13,7 +13,7 @@ mod base64_serde {
|
||||
use super::super::Pixel;
|
||||
use serde::{Deserialize, Deserializer, Serializer};
|
||||
|
||||
pub fn as_base64<S, P: Pixel>(key: &Vec<P>, serializer: S) -> Result<S::Ok, S::Error>
|
||||
pub fn as_base64<S, P: Pixel>(key: &[P], serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
S: Serializer,
|
||||
{
|
||||
@@ -27,7 +27,7 @@ mod base64_serde {
|
||||
{
|
||||
use serde::de::Error;
|
||||
|
||||
let color_from_chunk = |chunk: &[u8]| P::from_bytes(chunk.try_into().unwrap());
|
||||
let color_from_chunk = |chunk: &[u8]| P::from_bytes(chunk);
|
||||
|
||||
let colors_from_bytes = |bytes: Vec<u8>| bytes.chunks_exact(P::byte_size()).map(color_from_chunk).collect();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user