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:
parent
b2b11257f5
commit
da81dfa07f
@ -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());
|
||||
}
|
||||
```
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user