Skip to content

Commit

Permalink
style(lints): count string characters directly (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieleades authored Feb 3, 2025
1 parent 4df41f0 commit 1917a15
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion examples/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub fn round_trip_string<M>(model: M, input: &str)
where
M: Model<Symbol = char> + Clone,
{
let input_bytes = input.bytes().len();
let input_bytes = input.len();

let buffer = encode(model.clone(), input.chars());

Expand Down
2 changes: 1 addition & 1 deletion examples/sherlock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ fn main() {
let mut file = File::open("./resources/sherlock.txt").unwrap();
let mut input = String::new();
file.read_to_string(&mut input).unwrap();
let input_bytes = input.bytes().len();
let input_bytes = input.len();

let model = StringModel::new(ALPHABET.chars().collect());

Expand Down

0 comments on commit 1917a15

Please sign in to comment.