Skip to content

Commit

Permalink
fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
younies committed Jan 4, 2024
1 parent 89a3a8d commit 3c0c3f7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions experimental/unitsconversion/src/measureunit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use smallvec::SmallVec;
use zerotrie::{ZeroTrie, ZeroTrieSimpleAscii, ZeroTrieSimpleAsciiCursor};
use zerotrie::{ZeroTrieSimpleAscii};
use zerovec::ZeroVec;

use crate::{
power::get_power,
provider::{Base, MeasureUnitItem, SiPrefix},
provider::{MeasureUnitItem, SiPrefix},
si_prefix::get_si_prefix,
ConversionError,
};
Expand Down Expand Up @@ -54,7 +54,7 @@ impl<'data> MeasureUnitParser<'data> {
return Ok((power, part));
}

if part_without_power.starts_with("-") {
if part_without_power.starts_with('-') {
return Ok((power, &part_without_power[1..]));
}

Expand All @@ -67,7 +67,7 @@ impl<'data> MeasureUnitParser<'data> {
return (si_prefix, part);
}

if part_without_si_prefix.starts_with("-") {
if part_without_si_prefix.starts_with('-') {
return (si_prefix, &part_without_si_prefix[1..]);
}

Expand Down
2 changes: 1 addition & 1 deletion experimental/unitsconversion/src/power.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// called LICENSE at the top level of the ICU4X source tree
// (online at: https://github.com/unicode-org/icu4x/blob/main/LICENSE ).

use zerotrie::{ZeroTrieSimpleAscii, ZeroTrieSimpleAsciiCursor};
use zerotrie::{ZeroTrieSimpleAscii};

/// A trie that contains the powers.
const POWERS_TRIE: ZeroTrieSimpleAscii<[u8; 64]> = ZeroTrieSimpleAscii::from_sorted_str_tuples(&[
Expand Down
2 changes: 1 addition & 1 deletion experimental/unitsconversion/src/si_prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const DECIMAL_PREFIXES_TRIE: ZeroTrieSimpleAscii<[u8; 167]> =
fn get_si_prefix_base_ten(part: &str) -> (i8, &str) {
let mut cursor = DECIMAL_PREFIXES_TRIE.cursor();

let mut longest_match = (0 as i8, part);
let mut longest_match = (0_i8, part);
for (i, b) in part.bytes().enumerate() {
cursor.step(b);
if cursor.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion experimental/unitsconversion/tests/units_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use core::str::FromStr;
use icu_unitsconversion::measureunit::MeasureUnitParser;
use num::BigRational;
use std::collections::HashSet;
use zerotrie::{ZeroTrie, ZeroTrieSimpleAscii};
use zerotrie::{ZeroTrieSimpleAscii};

/// Convert a decimal number to a BigRational.
fn convert_decimal_to_rational(decimal: &str) -> Option<BigRational> {
Expand Down

0 comments on commit 3c0c3f7

Please sign in to comment.