Top "Rust" questions

Rust is a systems programming language without a garbage collector focused on three goals: safety, speed, and concurrency.

How to convert Vec<char> to a string

How to convert Vec<char> to string form so that I can print it?

string rust
How can I convert char to string?

This question pertains to a pre-release version of Rust. This younger question is similar. I tried to print one symbol …

rust rust-obsolete
Creating a vector of zeros for a specific size

I'd like to initialize a vector of zeros with a specific size that is determined at runtime. In C, it …

rust
How do I use a macro across module files?

I have two modules in separate files within the same crate, where the crate has macro_rules enabled. I want …

module rust rust-macros
How to make a reverse ordered for loop in Rust?

Editor's note: This question was asked before Rust 1.0 was released and the .. "range" operator was introduced. The question's code no …

for-loop rust
What does Rust have instead of a garbage collector?

I understand Rust doesn't have a garbage collector and am wondering how memory is freed up when a binding goes …

rust
What is the difference between iter and into_iter?

I am doing the Rust by Example tutorial which has this code snippet: // Vec example let vec1 = vec![1, 2, 3]; let vec2 = …

rust
How to print a Vec?

I tried the following code: fn main() { let v2 = vec![1; 10]; println!("{}", v2); } But the compiler complains: error[E0277]: `std::vec::…

rust println
How do I iterate over a range with a custom step?

How can I iterate over a range in Rust with a step other than 1? I'm coming from a C++ background …

rust
Using map with Vectors

Although vectors are best suited for procedural programming, I would like to use a map function on them. The following …

rust