From af922fb67072de055f11adbea8b55f7e1e4d6cdd Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Tue, 6 Aug 2019 09:27:09 -0700 Subject: [PATCH] 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. --- examples/todomvc/src/store.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/todomvc/src/store.rs b/examples/todomvc/src/store.rs index 3de6909a..cb803b26 100644 --- a/examples/todomvc/src/store.rs +++ b/examples/todomvc/src/store.rs @@ -67,9 +67,9 @@ impl Store { array.push(&JsValue::from(child)); } 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 - .set_item(&self.name, storage_string.as_str()) + .set_item(&self.name, &storage_string) .unwrap(); } }