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()...
  • May 22, 2022
  • 0 Comments
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...
  • May 21, 2022
  • 0 Comments
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
  • May 21, 2022
  • 0 Comments
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...
  • May 16, 2022
  • 0 Comments
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...
  • May 14, 2022
  • 0 Comments
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);...
  • May 13, 2022
  • 0 Comments