Rustではあるタイプの配列やベクトルを別のタイプに変換する慣用方法は何でしょうか?所望の効果が let x = ~[0 as int, 1 as int, 2 as int];
let y = vec::map(x, |&e| { e as uint });
ですが、私は同じことがスカラー型キャストに似て、より簡潔な形で達成することができたかはわかりません。 私は錆のマニュアルやリファレン
イディオムでタイプ~strのキーでHashMapを使用する方法を理解するのに問題があります。例えば、thisバグレポートに基づいて let mut map: hashmap::HashMap<~str, int> = hashmap::HashMap::new();
// Inserting is fine, I just have to copy the string.
map.insert