maciejhirsz / json-rust

JSON implementation in Rust
Apache License 2.0
563 stars 63 forks source link

new array![] requires Copy on elements #179

Closed njaard closed 4 years ago

njaard commented 4 years ago
{
        let owned = String::new();
//|         ----- move occurs because `owned` has type `std::string::String`, which does not implement the `Copy` trait
        array![    owned];
//|     -----------^^^^^--
//|     |          |
//|     |          variable moved due to use in closure
//|     |          value used here after move
//|     value moved into closure here
}
njaard commented 4 years ago

p.s. Thanks for all the effort you put into your crate.

maciejhirsz commented 4 years ago

Thanks for the report! Gonna add a test case on my wip branch so we don't get a regression in the future.