I was reading the lifetimes chapter of the Rust book, and I came across this example for a named/explicit lifetime: struct Foo<'a> { x: &'a i32, } fn main()...
Just having found Rust and having read the first two chapters of the documentation, I find the approach and the way they defined the language particularly interesting. So I...
From the documentation, it’s not clear. In Java you could use the split method like so: "some string 123 ffd".split("123"); 6 Answers 6
I’m learning/experimenting with Rust, and in all the elegance that I find in this language, there is one peculiarity that baffles me and seems totally out of place. Rust...
I would like to make a Rust package that contains both a reusable library (where most of the program is implemented), and also an executable that uses it. Assuming...
I have a value and I want to store that value and a reference to something inside that value in my own type: struct Thing { count: u32, }...
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only...
I’m trying to figure out how to match a String in Rust. I initially tried matching like this, but I figured out Rust cannot implicitly cast from std::string::String to...
Note: this question contains deprecated pre-1.0 code! The answer is correct, though. To convert a str to an int in Rust, I can do this: let my_int = from_str::<int>(my_str);...
I am doing the Rust by Example tutorial which has this code snippet: // Vec example let vec1 = vec![1, 2, 3]; let vec2 = vec![4, 5, 6]; //...