Skip to content

Commit af922fb

Browse files
authored
Fixup styling in sync_local_storage
- `storage_string` is already a `JsString`, calling `to_string` is redundant - `as_str` is not required, so it is more idiomatic to just use a borrow.
1 parent 640c807 commit af922fb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/todomvc/src/store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ impl Store {
6767
array.push(&JsValue::from(child));
6868
}
6969
if let Ok(storage_string) = JSON::stringify(&JsValue::from(array)) {
70-
let storage_string: String = storage_string.to_string().into();
70+
let storage_string: String = storage_string.into();
7171
self.local_storage
72-
.set_item(&self.name, storage_string.as_str())
72+
.set_item(&self.name, &storage_string)
7373
.unwrap();
7474
}
7575
}

0 commit comments

Comments
 (0)