Skip to main content

RUST-LANG

runnig rust programme

$ sudo rustc main.rs  : debugged and apk ready file by name "main"

$ ./main                     : run "main" which was debugg of main.rs


converting a normal rust project into cargo project

in the same directory where your main source code and project is present type

$ cargo new Proj_name   : creation of project as cargo new

$ cd Proj_name                

installing cargo by 

$ cargo build                  : building a project

and running every project on it by

$./target/debug/hello_cargo

$ cargo run                     : build and run in one step

$ cargo check                 : build and check(errors) without runnig binaries 

when project is ready for release use

$ cargo build --release


to checkout any project using cargo

$ git clone some projece.org/project

$ cd some project 

$ cargo build


some anolodgy from c

include             use

<stdio.h>         std::io

#include<stdio.h>         use std::io 

int main()          fn main() {

commenting // is same

let mut x,i,j; 

"let mut " declares mutable variables(which can be changed later )

Comments