#error in Map

2 messages · Page 1 of 1 (latest)

sand narwhal
#

#![no_std]
use soroban_sdk::{contract,contractimpl, Symbol, Map, Env};

const ex: u64 = 32;
#[contract]
pub struct SimpleContract;

#[contractimpl]
impl SimpleContract {
pub fn set_value(env: Env, value: Symbol, key: u64) {
let mut data = Map::new(&env);
data.set(&key, &value);
env.storage().persistent().set(&ex, &data);
}
}

he trait bound &u64: TryFromVal<Env, soroban_sdk::Val> is not satisfied

12
data.set(&key, &value);
^ the trait TryFromVal<Env, soroban_sdk::Val> is not implemented for &u64

following error please help with it

hollow dust
#

U64 doesnt impl tryfromval as its a native type