Top "Rust" questions

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

Convert a String to int in Rust?

Note: this question contains deprecated pre-1.0 code! The answer is correct, though. To convert a str to an int in …

rust
How do I split a string in Rust?

From the documentation, it's not clear. In Java you could use the split method like so: "some string 123 ffd".split("123");

rust
How do I concatenate strings?

How do I concatenate the following combinations of types: str and str String and str String and String

string rust string-concatenation
Is it possible to use global variables in Rust?

I know that in general, global-variables are to be avoided. Nevertheless, I think in a practical sense, it is sometimes …

global-variables rust
How to disable unused code warnings in Rust?

struct SemanticDirection; fn main() {} warning: struct is never used: `SemanticDirection` --> src/main.rs:1:1 | 1 | struct SemanticDirection; | ^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: #[warn(dead_…

warnings compiler-warnings rust dead-code
How to include a module from another file from the same project?

By following this guide I created a Cargo project. src/main.rs fn main() { hello::print_hello(); } mod hello { pub …

rust
How do I print the type of a variable in Rust?

I have the following: let mut my_number = 32.90; How do I print the type of my_number? Using type and …

types rust
How do I convert from an integer to a string?

I am unable to compile code that converts a type from an integer to a string. I'm running an example …

string int type-conversion rust
What is the equivalent of the join operator over a vector of Strings?

I wasn't able to find the Rust equivalent for the "join" operator over a vector of Strings. I have a …

string rust
How to match a String against string literals in Rust?

I'm trying to figure out how to match a String in Rust. I initially tried matching like this, but I …

string match rust