Skip to content

Commit

Permalink
Addresses warnings new to clippy 1.75
Browse files Browse the repository at this point in the history
  • Loading branch information
zslayton committed Jan 10, 2024
1 parent c572b6d commit 7a40aff
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
1 change: 0 additions & 1 deletion src/element/builders.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ macro_rules! ion_seq {
}

use crate::{List, SExp};
pub use {ion_list, ion_sexp, ion_struct};

#[cfg(test)]
mod tests {
Expand Down
1 change: 0 additions & 1 deletion src/lazy/encoder/binary/v1_1/flex_uint.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use crate::lazy::binary::immutable_buffer::ParseResult;
use crate::result::IonFailure;
use crate::IonResult;
use std::io::Write;
Expand Down
12 changes: 6 additions & 6 deletions src/text/parsers/timestamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@ fn timezone_offset_hours_minutes(input: &str) -> IonParseResult<(i32, i32)> {
Ok((remaining_input, (hour_int, minute_int)))
}

/// Matches the next input character if it is a base-10 digit. This wraps [char::is_digit] in the
/// nom parsing function signature.
pub(crate) fn digit(input: &str) -> IResult<&str, char> {
satisfy(|c| c.is_ascii_digit())(input)
}

#[cfg(test)]
mod reader_tests {
use crate::result::IonResult;
Expand Down Expand Up @@ -450,9 +456,3 @@ mod reader_tests {
Ok(())
}
}

/// Matches the next input character if it is a base-10 digit. This wraps [char::is_digit] in the
/// nom parsing function signature.
pub(crate) fn digit(input: &str) -> IResult<&str, char> {
satisfy(|c| c.is_ascii_digit())(input)
}
1 change: 0 additions & 1 deletion src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ mod r#struct;
mod symbol;
mod timestamp;

pub use crate::element::Sequence;
pub use crate::types::bytes::Bytes;
pub use decimal::Decimal;
pub use integer::{Int, UInt};
Expand Down
6 changes: 6 additions & 0 deletions src/types/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ impl Struct {
}

/// Returns an iterator over the field name/value pairs in this Struct.
#[allow(clippy::map_identity)]
// ^-- This is a temporary workaround for a bug in Clippy that should be fixed in the next release.
// See: https://github.com/rust-lang/rust-clippy/issues/9280
pub fn fields(&self) -> impl Iterator<Item = (&Symbol, &Element)> {
self.fields
.iter()
Expand Down Expand Up @@ -234,6 +237,9 @@ impl Struct {
self.fields.get_all(field_name)
}

#[allow(clippy::map_identity)]
// ^-- This is a temporary workaround for a bug in Clippy that should be fixed in the next release.
// See: https://github.com/rust-lang/rust-clippy/issues/9280
pub(crate) fn get_index(&self, field_index: usize) -> Option<(&Symbol, &Element)> {
self.fields
.by_index
Expand Down

0 comments on commit 7a40aff

Please sign in to comment.