Skip to content

This repository comprises concepts and examples related to the Rust programming language. It provides a resource for understanding and practicing Rust language concepts through practical examples.

Notifications You must be signed in to change notification settings

jitendragangwar123/Learn-Rust-With-Examples

Repository files navigation

Learn-Rust-With-Examples

This repository comprises concepts and examples related to the Rust programming language. It provides a resource for understanding and practicing Rust language concepts through practical examples.

Resources

Table Of Contents

For MacOS:

// Installation
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
  Rust is installed now. Great!
$ rustc –-version // check the version
$ rustup update  // updating 
$ rustup self uninstall // uninstalling

// Create New Project
$ mkdir ~/RustWithExamples
$ cd ~/RustWithExamples
$ touch hello_world.rs // create rust file
$ rustc hello_world.rs // to compile the file
$ ./hello_world // to run the file
  Hello, world!  // output

For Linux:

// Installation
$ sudo apt-get install rustc cargo
$ cargo --version // to check the cargo version
$ cargo new my_project or cargo init // Create New Project
$ cargo build //to build the project means compiles the project, and generates an executable file in the target/debug directory
$ cargo build --release // to create a production ready executable
$ cargo run or ./target/debug/hello_world.exe // to run the executable file
$ cargo check // to check the syntax and type-checking

Cargo.toml: Store metadata about your project
    [package]
    name = "my_project"
    version = "0.1.0"
    authors = ["Your Name <your@email.com>"]
    [dependencies]
    rand = "0.8.4"

About

This repository comprises concepts and examples related to the Rust programming language. It provides a resource for understanding and practicing Rust language concepts through practical examples.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published