I'm trying to make some changes to the Flipper contract, trying to use a vector like the documentation say's it should be imported:
#[ink::contract]
pub mod flipper_plus {
use ink::storage::Mapping;
use ink::prelude::vec::Vec;
and during compilation got this errors:
error[E0432]: unresolved import `crate::flipper_plus::vec`
--> /Users/pierina/Documents/rust_projects/flipper-contract/contracts/flipperPlus/src/lib.rs:7:30
|
7 | use crate::flipper_plus::vec::Vec;
| ^^^ could not find `vec` in `flipper_plus`
error: cannot find macro `vec` in this scope
--> /Users/pierina/Documents/rust_projects/flipper-contract/contracts/flipperPlus/src/lib.rs:33:26
|
33 | history: vec![(caller, init_value, Self::env().block_timestamp())],
| ^^^
Here is my Cargo.toml
:
[package]
name = "flipper_plus"
version = "0.1.0"
authors = [""]
edition = "2021"
[dependencies]
ink = { version = "4.0.0", default-features = false }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.3", default-features = false, features = ["derive"], optional = true }
[lib]
name = "flipper_plus"
path = "src/lib.rs"
crate-type = [
# Used for normal contract Wasm blobs.
"cdylib",
]
[features]
default = ["std"]
std = [
"ink/std",
"scale/std",
"scale-info/std"
]
ink-as-dependency = []
use ink::prelude::{ vec, vec::Vec }