MCPcopy Create free account
hub / github.com/Apress/beginning-rust-2e / length

Method length

Source Code/19-23.rs:8–8  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

6 }
7 impl HasLength for str {
8 fn length(&self) -> usize { self.chars().count() }
9 }
10 let s = "ۏe";
11 print!("{} {}", s.len(), s.length());

Callers

nothing calls this directly

Calls 1

countMethod · 0.45

Tested by

no test coverage detected