Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Rust で、あるタイプの配列またはベクトルを別のタイプに変換する慣用的な方法は何でしょうか? 望む効果は
let x = ~[0 as int, 1 as int, 2 as int]; let y = vec::map(x, |&e| { e as uint });
しかし、スカラー型キャストと同様に、より簡潔な方法で同じことが達成できるかどうかはわかりません。
Rust のマニュアルやリファレンスで手がかりを見つけるのに失敗しているようです。ティア。