You've already forked AstralRinth
forked from didirus/AstralRinth
Adds ordering on loader fields enum (#755)
* now sorts on ordering, fmt clippy prepare * fixed tests * removed accidenetal printlns
This commit is contained in:
@@ -13,7 +13,7 @@ pub fn get_color_from_img(data: &[u8]) -> Result<Option<u32>, ImageError> {
|
||||
.crop_imm(128, 128, 64, 64);
|
||||
let color = color_thief::get_palette(image.to_rgb8().as_bytes(), ColorFormat::Rgb, 10, 2)
|
||||
.ok()
|
||||
.and_then(|x| x.get(0).copied())
|
||||
.and_then(|x| x.first().copied())
|
||||
.map(|x| (x.r as u32) << 16 | (x.g as u32) << 8 | (x.b as u32));
|
||||
|
||||
Ok(color)
|
||||
|
||||
@@ -34,7 +34,7 @@ pub fn validation_errors_to_string(errors: ValidationErrors, adder: Option<Strin
|
||||
output
|
||||
}
|
||||
ValidationErrorsKind::Field(errors) => {
|
||||
if let Some(error) = errors.get(0) {
|
||||
if let Some(error) = errors.first() {
|
||||
if let Some(adder) = adder {
|
||||
output.push_str(&format!(
|
||||
"Field {} {} failed validation with error: {}",
|
||||
|
||||
Reference in New Issue
Block a user