Back to articles
[Rust Guide] 1.2. Basic Understanding of Rust and Printing "Hello World"

[Rust Guide] 1.2. Basic Understanding of Rust and Printing "Hello World"

via Dev.toSomeB1oody

1.2.0. Side Note I will continue using RustRover for demonstrations in future articles. 1.2.1. Writing Rust Programs File extension: .rs Naming convention: Snake case (lowercase letters, words separated by underscores) Example: hello_world.rs 1.2.2. Printing Hello World Step 1: Create a New Rust Project Open RustRover, click "New Project", and you'll see the following interface: Modify the project storage path or select the toolchain location according to your needs, then click create. If the IDE doesn't recognize the toolchain, please check if you have downloaded and installed Rust - there's an installation tutorial on the homepage. Step 2: Write Code Since RustRover automatically configures Cargo for new projects (we'll cover this next time), the project will directly generate main.rs with Hello World printing code: Understanding the code: fn main (){ println! ( "Hello World" ); } fn : Indicates creating a function (equivalent to function in JS, func in Go, def in Python) main(){} :

Continue reading on Dev.to

Opens in a new tab

Read Full Article
3 views

Related Articles