From 93564f159faede1b85a7ed4e216d1204008c8415 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 29 Oct 2018 13:47:09 -0700 Subject: [PATCH] Fix build of TODO MVC on stable --- examples/todomvc/Cargo.toml | 4 ---- examples/todomvc/build.sh | 4 ++-- examples/todomvc/src/lib.rs | 1 - examples/todomvc/src/scheduler.rs | 4 ++-- examples/todomvc/src/store.rs | 1 - 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/examples/todomvc/Cargo.toml b/examples/todomvc/Cargo.toml index 8e8bd3bf..3693ae9e 100644 --- a/examples/todomvc/Cargo.toml +++ b/examples/todomvc/Cargo.toml @@ -6,10 +6,6 @@ authors = ["The wasm-bindgen Developers"] [lib] crate-type = ["cdylib"] -[profile.release] -lto = true -opt-level = 's' - [build-dependencies] askama = "0.7.2" diff --git a/examples/todomvc/build.sh b/examples/todomvc/build.sh index 23ba0682..018ae71c 100755 --- a/examples/todomvc/build.sh +++ b/examples/todomvc/build.sh @@ -5,9 +5,9 @@ set -ex cd "$(dirname $0)" -cargo +nightly build --target wasm32-unknown-unknown +cargo build --target wasm32-unknown-unknown -cargo +nightly run --manifest-path ../../crates/cli/Cargo.toml \ +cargo run --manifest-path ../../crates/cli/Cargo.toml \ --bin wasm-bindgen -- \ ../../target/wasm32-unknown-unknown/debug/todomvc.wasm --out-dir . diff --git a/examples/todomvc/src/lib.rs b/examples/todomvc/src/lib.rs index 49e8b4b6..83a4dcc7 100644 --- a/examples/todomvc/src/lib.rs +++ b/examples/todomvc/src/lib.rs @@ -10,7 +10,6 @@ extern crate js_sys; extern crate web_sys; use std::rc::Rc; -#[macro_use] extern crate askama; /// Controller of the program diff --git a/examples/todomvc/src/scheduler.rs b/examples/todomvc/src/scheduler.rs index 23f1eb91..59906ab2 100644 --- a/examples/todomvc/src/scheduler.rs +++ b/examples/todomvc/src/scheduler.rs @@ -26,7 +26,7 @@ impl Scheduler { pub fn set_controller(&self, controller: Controller) { if let Ok(mut controller_data) = self.controller.try_borrow_mut() { - controller_data.replace(controller); + *controller_data = Some(controller); } else { exit("This might be a deadlock"); } @@ -34,7 +34,7 @@ impl Scheduler { pub fn set_view(&self, view: View) { if let Ok(mut view_data) = self.view.try_borrow_mut() { - view_data.replace(view); + *view_data = Some(view); } else { exit("This might be a deadlock"); } diff --git a/examples/todomvc/src/store.rs b/examples/todomvc/src/store.rs index 6e29e68e..61380cd0 100644 --- a/examples/todomvc/src/store.rs +++ b/examples/todomvc/src/store.rs @@ -1,6 +1,5 @@ use js_sys::JSON; use wasm_bindgen::prelude::*; -use crate::exit; /// Stores items into localstorage pub struct Store {