1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-01-10 00:44:21 +02:00

Simplify char count

This commit is contained in:
Martin Geisler 2023-01-10 19:54:48 +01:00 committed by GitHub
parent b2b11257f5
commit da81dfa07f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,7 +15,7 @@ fn main() {
let s3 = String::from("🇨🇭");
println!("s3: len = {}, number of chars = {}", s3.len(),
s3.chars().collect::<std::vec::Vec<_>>().len());
s3.chars().count());
}
```