From b74718b6bcd1eb753b0fb66f3c557812c068e674 Mon Sep 17 00:00:00 2001 From: king6cong Date: Mon, 17 Apr 2017 12:05:00 +0800 Subject: [PATCH] make example compilable eliminate: cannot infer type for `K` --- README.md | 5 +++-- src/lib.rs | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2e2b029..7bf2de8 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ That file is normally called `src/main.rs` for executables and ``` This will make stainless available when you run the tests using `cargo -test`. +test`. When using stainless only with a library, make sure to run tests using `cargo test --lib`. @@ -146,7 +146,8 @@ mod tests { describe! stainless { it "can use HashMap" { - let map = HashMap::new(); + let mut map = HashMap::new(); + map.insert("key", "value"); } } } diff --git a/src/lib.rs b/src/lib.rs index 8def73a..57c187f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -154,7 +154,8 @@ //! //! describe! stainless { //! it "can use HashMap" { -//! let map = HashMap::new(); +//! let mut map = HashMap::new(); +//! map.insert("key", "value"); //! } //! } //! }