Skip to content

Commit

Permalink
fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Samuels committed Oct 4, 2024
1 parent 798ff79 commit de47d93
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ proptest = ["dep:proptest"]
rand = ["dep:rand"]
rkyv = ["dep:rkyv"]
rkyv-safe = ["rkyv/validation"]
rocket-traits = ["dep:rocket"]
rocket-traits = ["dep:rocket", "std"]
rust-fuzz = ["dep:arbitrary"]
serde = ["dep:serde"]
serde-arbitrary-precision = ["serde-with-arbitrary-precision"]
Expand Down
2 changes: 1 addition & 1 deletion src/decimal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ impl Decimal {
pub fn from_scientific(value: &str) -> Result<Decimal, Error> {
const ERROR_MESSAGE: &str = "Failed to parse";

let mut split = value.splitn(2, |c| c == 'e' || c == 'E');
let mut split = value.splitn(2, ['e', 'E']);

let base = split.next().ok_or_else(|| Error::from(ERROR_MESSAGE))?;
let exp = split.next().ok_or_else(|| Error::from(ERROR_MESSAGE))?;
Expand Down
2 changes: 2 additions & 0 deletions src/serde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,8 +370,10 @@ impl<'de> serde::de::Visitor<'de> for DecimalVisitor {
}
}

#[cfg(any(feature = "serde-with-float", feature = "serde-with-arbitrary-precision"))]
struct OptionDecimalVisitor;

#[cfg(any(feature = "serde-with-float", feature = "serde-with-arbitrary-precision"))]
impl<'de> serde::de::Visitor<'de> for OptionDecimalVisitor {
type Value = Option<Decimal>;

Expand Down

0 comments on commit de47d93

Please sign in to comment.