Skip to navigation
Check if a rust hashmap includes a key
02.09.22
let sql = "SELECT id ,av0_code ,CONVERT(varchar(30),CONVERT(datetime, [rv]),126) as rv FROM [SL_customer].[dbo].[av0_code]"; println!("{}",sql); let h_r = get_vec(sql).await.unwrap(); let mut h_source: HashMap
= HashMap::new(); for i in &h_r { let h_code = i[1].to_string(); let h_rv = i[2].to_string(); h_source.insert(h_code, h_rv); } println!("{}", h_source.contains_key("14BCx")); Ok(())
https://turreta.com/2019/09/23/rust-check-if-key-exists-in-hashmap/
Reply
Anonymous
Information Epoch 1745563160
Data dominates.
Home
Notebook
Contact us