1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/TheAlgorithms-Rust

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
CONTRIBUTING.md 866
Копировать Редактировать Web IDE Исходные данные Просмотреть построчно История
dsmurrow Отправлено 26.03.2023 19:04 6ae53e5

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 !

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://api.gitlife.ru/oschina-mirror/TheAlgorithms-Rust.git
git@api.gitlife.ru:oschina-mirror/TheAlgorithms-Rust.git
oschina-mirror
TheAlgorithms-Rust
TheAlgorithms-Rust
master