Skip to content

Commit

Permalink
Clippy.
Browse files Browse the repository at this point in the history
  • Loading branch information
Narsil committed Feb 6, 2024
1 parent 48255f5 commit d10aacb
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions tokenizers/src/tokenizer/normalizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ use unicode_normalization_alignments::UnicodeNormalization;

use serde::{Deserialize, Serialize};

/// Add or Substract a signed isize on a usize. Makes sure of avoiding
/// any substraction overflow, flooring at 0.
macro_rules! apply_signed {
($origin: expr, $signed: expr) => {
if $signed.is_positive() {
$origin += $signed as usize;
} else {
let (result, overflow) = $origin.overflowing_sub(-($signed) as usize);
$origin = if overflow { 0 } else { result };
}
};
}

/// The possible offsets referential
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum OffsetReferential {
Expand Down

0 comments on commit d10aacb

Please sign in to comment.