removed gratuitous Arc
This commit is contained in:
parent
1c4b158ac3
commit
5ca20f4cfd
@ -3,11 +3,10 @@ use gloo_console::log;
|
|||||||
extern crate wasm_bindgen_futures;
|
extern crate wasm_bindgen_futures;
|
||||||
extern crate wasm_cookies;
|
extern crate wasm_cookies;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
use std::sync::Arc;
|
|
||||||
|
|
||||||
#[derive(Properties, Clone, PartialEq)]
|
#[derive(Properties, Clone, PartialEq)]
|
||||||
struct CookieProps {
|
struct CookieProps {
|
||||||
cookie: Arc<String>,
|
cookie: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl CookieProps {
|
impl CookieProps {
|
||||||
@ -17,7 +16,7 @@ impl CookieProps {
|
|||||||
match wasm_cookies::get("test") {
|
match wasm_cookies::get("test") {
|
||||||
Some(Ok(cookie)) => {
|
Some(Ok(cookie)) => {
|
||||||
log!("got cookie");
|
log!("got cookie");
|
||||||
return Self { cookie: Arc::new(cookie) };
|
return Self { cookie: cookie };
|
||||||
}
|
}
|
||||||
Some(Err(e)) => {
|
Some(Err(e)) => {
|
||||||
log!(format!("cookie error: {}", e));
|
log!(format!("cookie error: {}", e));
|
||||||
@ -28,7 +27,7 @@ impl CookieProps {
|
|||||||
}
|
}
|
||||||
log!("setting cookie");
|
log!("setting cookie");
|
||||||
wasm_cookies::set("test", "123", &cookie_options);
|
wasm_cookies::set("test", "123", &cookie_options);
|
||||||
let cookie = Arc::new("123".to_string());
|
let cookie = "123".to_string();
|
||||||
// XXX Don't do this!! No secrets in logs!
|
// XXX Don't do this!! No secrets in logs!
|
||||||
// log!(&cookie);
|
// log!(&cookie);
|
||||||
Self { cookie }
|
Self { cookie }
|
||||||
|
Reference in New Issue
Block a user