Skip to content

emo-crab/rust-template

Repository files navigation

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

rust-template

A Rust project template that works with cargo-generate!
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

About The Project

This is a Rust project template designed to work seamlessly with cargo-generate. It provides a solid foundation for starting new Rust projects with best practices already configured.

Key features:

  • Pre-configured Cargo.toml with optimized release profiles
  • Basic project structure with error handling using thiserror
  • Rust formatting and linting configurations (.rustfmt.toml, .clippy.toml)
  • Ready-to-use GitHub Actions workflows
  • MIT License included

This template helps you focus on building your project instead of setting up boilerplate code.

(back to top)

Built With

This template is configured for Rust projects and includes:

(back to top)

Getting Started

This template is designed to work with cargo-generate, which allows you to quickly create a new Rust project from this template.

Prerequisites

First, you need to install cargo-generate:

cargo install cargo-generate

Installation

To create a new project from this template, use the following command:

cargo generate --git https://github.com/emo-crab/rust-template

You'll be prompted to provide:

  • Project name: The name of your new project
  • GitHub username: Your GitHub username or organization name
  • Project description: A brief description of your project

Alternatively, you can clone this repository and use it as a starting point:

git clone https://github.com/emo-crab/rust-template.git
cd rust-template
# Make your changes

(back to top)

Usage

After generating your project from this template, you can:

  1. Build your project:

    cargo build
  2. Run tests:

    cargo test
  3. Run your project (if you add a binary):

    cargo run
  4. Format your code:

    cargo fmt
  5. Run linting:

    cargo clippy

This template includes optimized release profiles for smaller binary sizes and better performance. Check the Cargo.toml file for details.

(back to top)

Roadmap

  • Add Changelog
  • Add back to top links
  • Add Additional Templates w/ Examples
  • Add "components" document to easily copy & paste sections of the readme
  • Multi-language Support
    • Chinese
    • Spanish

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE for more information.

(back to top)

Contact

Your Name - @your_twitter - email@example.com

Project Link: https://github.com/emo-crab/rust-template

(back to top)

Acknowledgments

Use this space to list resources you find helpful and would like to give credit to. I've included a few of my favorites to kick things off!

(back to top)

About

cargo generate Rust项目模板

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 2

  •  
  •