Skip to content

Learning rust language is tough for me, so record practice here.

License

Notifications You must be signed in to change notification settings

deranson/climbing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Climbing

License: MIT

Learning rust language is tough for me, so record practice here.

Structure

 climbing/
 ┣ docs
 ┃ ┗ strings.md
 ┃ ┗ foo.md
 ┃ ┗ ...
 ┃
 ┣ src
 ┃ ┗ modules
 ┃   ┗ strings.rs
 ┃   ┗ foo.rs
 ┃   ┗ ...
 ┃
 ┃ ┗ modules.rs
 ┃ ┗ main.rs
main.rs
mod modules;

use modules::strings::qstring;

fn main() {
   let quote = qstring("Learning rust language is tough for me, so record practice here");

   println!("{}", quote);
}
...
modules.rs
pub mod strings;

...
modules/strings.rs
/// Create String from &str directly

pub fn qstring(str: &str) -> String {
    String::from(str)
}

...

Usage

  • Install rust in your local follow this guide (Note: this repository uses the rust package manager Cargo)
  • Clone this repository to your local
  • Reference and use modules in main.rs
  • Cd the root dir
  • Run cargo run command

Docs

For example, docs/foo.md is the note of the code src/modules/foo.rs of the content Foo in Rust lang.

Contents & Docs & Modules

Contents Docs Modules
String strings.md strings.rs
Variables and Mutability variables_mutability.md variables_mutability.rs

License

MIT

About

Learning rust language is tough for me, so record practice here.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages