Answers for "rust equivalent of dictionary"

0

rust equivalent of dictionary

You can use a Structure

struct Data {
	randomInfo: String
}

let mut Data {
	randomInfo: "This is a structure"
}

/* The mut keyword defines whether or not you can mutate (change)
 the variable, so if you don't want ot be able to change the data then 
 don't use the mut keyword. Like so:
*/

let Data {
	randomInfo: "This is a structure"
}
Posted by: Guest on January-08-2022

Browse Popular Code Answers by Language