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.
This commit is contained in:
Benjamin Lee 2019-08-06 09:27:09 -07:00 committed by GitHub
parent 640c807736
commit af922fb670
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,9 +67,9 @@ impl Store {
array.push(&JsValue::from(child)); array.push(&JsValue::from(child));
} }
if let Ok(storage_string) = JSON::stringify(&JsValue::from(array)) { if let Ok(storage_string) = JSON::stringify(&JsValue::from(array)) {
let storage_string: String = storage_string.to_string().into(); let storage_string: String = storage_string.into();
self.local_storage self.local_storage
.set_item(&self.name, storage_string.as_str()) .set_item(&self.name, &storage_string)
.unwrap(); .unwrap();
} }
} }