What is this question mark operator about?
I’m reading the documentation for File: //.. let mut file = File::create(“foo.txt”)?; //.. What is the ? in this line? I do not … Read more
I’m reading the documentation for File: //.. let mut file = File::create(“foo.txt”)?; //.. What is the ? in this line? I do not … Read more
How do you access a Cargo package’s metadata (e.g. version) from the Rust code in the package? In my case, I am building … Read more
By following this guide I created a Cargo project. src/main.rs fn main() { hello::print_hello(); } mod hello { pub fn print_hello() { println!(“Hello, … Read more
What is the best way to create and use a struct with only one instantiation in the system? Yes, this is necessary, it … Read more
Just having found Rust and having read the first two chapters of the documentation, I find the approach and the way they defined … Read more
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 … Read more
I would like to make a Rust package that contains both a reusable library (where most of the program is implemented), and also … Read more
I have a value and I want to store that value and a reference to something inside that value in my own type: … Read more
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 … Read more