Skip to content

rust-logs/hello-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

hello-rust

"hello-rust" is a beginner-friendly Rust project demonstrating the basics of Rust programming, including project setup, common programming concepts, writing and running simple tests.

Learn by doing

This repository covers material from Chapter 3 - Common Programming Concepts of The Rust Programming Language Book.

You will learn how to:

  • Declare variables and constants
  • Work with data types
  • Write and call functions
  • Control flow (if, else, loop, while, for)
  • Basic testing (cargo test)

Getting Started

These instructions will help you set up and explore the project on your local machine.

Install Rust and Cargo

Clone the Repository

git clone https://github.com/rust-logs/hello-rust.git
cd hello-rust

Explore the Codebase

  • src/main.rs - Entry point of the application
  • src/lib.rs - Library file where reusable functions are defined
  • tests/test.rs - Contains tests to verify your code works as expected

Build and Run

cargo build 		# compiles the project
cargo run 		# runs the project

You should see output like:

Hello, Rust

Try modifying the name function in lib.rs and cargo run again to see how the output changes

Run Tests

This project includes a simple test for the name function.

cargo test

You should see output indicating whether tests passed or failed.

You can add your own tests in tests/test.rc

Contributing

We welcome beginner-friendly contributions

If you'd like to add examples, improve explanations, or fix typos, please read our Contributing Guide before starting.

It includes step-by-step instructions for forking the repo, creating branches, and submitting pull requests.

Code of conduct

This project follows a Code of Conduct to ensure safe and welcoming learning environment for everyone.

Please read it before participating in discussions or contributing.

License

This project is licensed under the MIT License. See LICENSE for more details

About

A beginner-friendly Rust project demonstrating basic Rust syntax and program structure

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors

Languages