I have two vectors:
let attributes = ["acousticness",
"danceability",
"duration_ms",
"energy",
"instrumentalness",
"key",
"liveness",
"loudness",
"mode",
"popularity",
"speechiness",
"tempo",
"time_signature",
"valence"];
let prefixs = ["min_", "max_", "target_"];
I want to get the permutations of this two vectors, so I do it with two iter():
for attribute in attributes {
for prefix in prefixs {
let param = prefix.to_owned() + attribute;
println!("{:?}",param);
}
}
Yes, it works. But I just wonder is there another elegant solution for my request ?