10 Star 56 Fork 24

编程语言算法集 / Rust

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CONTRIBUTING.md 866 Bytes
一键复制 编辑 原始数据 按行查看 历史
dsmurrow 提交于 2023-03-26 12:04 . Fix typo (#478)

The Algorithms: Rust

This project aims at showcasing common algorithms implemented in Rust, with an accent on idiomatic code and genericity.

Project structure

The project is organized as follows:

src/

  • my_algo_category/
    • mod.rs
    • my_algorithm.rs
    • some_other_algorithm.rs
  • some_other_algo_category/
    • ...

mod.rs contains the export:

mod my_algorithm;

pub use self::my_algorithm::my_algorithm;

my_algorithm.rs contains your algorithm and the related tests:

pub fn my_algorithm() {
    // ...
}

#[cfg(test)]
mod tests {
    #[test]
    fn my_test() {
        // ...
    }
}

Before submitting your PR

Do not use acronyms: DFS should be depth_first_search.

Make sure you run

  • cargo test
  • cargo fmt
  • cargo clippy --all -- -D warnings

And that's about it !

Rust
1
https://gitee.com/TheAlgorithms/Rust.git
git@gitee.com:TheAlgorithms/Rust.git
TheAlgorithms
Rust
Rust
master

搜索帮助