From 37871f9635650a9c3b80cbb36303ec45add96577 Mon Sep 17 00:00:00 2001 From: Ingvar Stepanyan Date: Tue, 10 Sep 2024 12:06:22 +0100 Subject: [PATCH] Remove some unnecessary allow() --- src/api/image_array/mod.rs | 3 ++- src/api/image_array/server.rs | 6 +++++- src/api/mod.rs | 6 +----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/api/image_array/mod.rs b/src/api/image_array/mod.rs index e97634b..929da79 100644 --- a/src/api/image_array/mod.rs +++ b/src/api/image_array/mod.rs @@ -59,7 +59,8 @@ pub(crate) enum TransmissionElementType { )] #[repr(i32)] pub(crate) enum ImageElementType { - I32 = TransmissionElementType::I32 as i32, + /// See [`TransmissionElementType::I32`]. + I32 = 2, } trait AsTransmissionElementType: 'static + Into + AnyBitPattern { diff --git a/src/api/image_array/server.rs b/src/api/image_array/server.rs index c013b23..ca9c07c 100644 --- a/src/api/image_array/server.rs +++ b/src/api/image_array/server.rs @@ -51,7 +51,11 @@ impl Response for ASCOMResult { }, ); bytes.extend_from_slice(bytes_of(&metadata)); - #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)] + #[allow( + clippy::as_conversions, + clippy::cast_possible_truncation, + clippy::cast_sign_loss + )] match img_array.transmission_element_type { TransmissionElementType::I32 => { bytes.extend(img_array.iter().flat_map(|&i| i.to_le_bytes())); diff --git a/src/api/mod.rs b/src/api/mod.rs index 1f6062a..d05ef8c 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -40,11 +40,7 @@ The SetupDialog method has been omitted from the Alpaca Device API because it pr */ -#![allow( - rustdoc::broken_intra_doc_links, - clippy::doc_markdown, - clippy::as_conversions, // triggers on derive-generated code https://github.com/rust-lang/rust-clippy/issues/9657 -)] +#![allow(clippy::doc_markdown)] mod bool_param; mod devices_impl;