Skip to content

Commit 1917a15

Browse files
authored
style(lints): count string characters directly (#74)
1 parent 4df41f0 commit 1917a15

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/common/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub fn round_trip_string<M>(model: M, input: &str)
4848
where
4949
M: Model<Symbol = char> + Clone,
5050
{
51-
let input_bytes = input.bytes().len();
51+
let input_bytes = input.len();
5252

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

examples/sherlock.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn main() {
5757
let mut file = File::open("./resources/sherlock.txt").unwrap();
5858
let mut input = String::new();
5959
file.read_to_string(&mut input).unwrap();
60-
let input_bytes = input.bytes().len();
60+
let input_bytes = input.len();
6161

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

0 commit comments

Comments
 (0)