mirror of
https://github.com/yewstack/yew.git
synced 2025-12-08 21:26:25 +00:00
improve speed of to_string for Classes (#772)
This commit is contained in:
parent
fd8c3ee665
commit
45574e53ae
@ -84,13 +84,11 @@ impl Classes {
|
||||
|
||||
impl ToString for Classes {
|
||||
fn to_string(&self) -> String {
|
||||
let mut buf = String::new();
|
||||
for class in &self.set {
|
||||
buf.push_str(class);
|
||||
buf.push(' ');
|
||||
}
|
||||
buf.pop();
|
||||
buf
|
||||
self.set
|
||||
.iter()
|
||||
.map(String::as_str)
|
||||
.collect::<Vec<&str>>()
|
||||
.join(" ")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user