szyk

Crates.ioszyk
lib.rsszyk
version1.0.2
sourcesrc
created_at2021-04-04 14:41:58.007182
updated_at2021-04-16 16:07:56.431617
descriptiongeneric topological sort
homepage
repositoryhttps://github.com/mnkisala/szyk-rs
max_upload_size
id378817
size7,592
(mnkisala)

documentation

https://docs.rs/szyk

README

szyk-rs

Generic topsort for Rust

crates.io

Example

use szyk::Node;
use szyk;

let result = szyk::sort(
    &[
        Node::new("wooden pickaxe", vec!["planks", "sticks"], "Pickaxe"),
        Node::new("planks", vec!["wood"], "Planks"),
        Node::new("sticks", vec!["planks"], "Sticks"),
        Node::new("wood", vec![], "Wood"),
    ],
    "wooden pickaxe",
);
assert_eq!(result, Ok(vec!["Wood", "Planks", "Sticks", "Pickaxe"]));
Commit count: 14

cargo fmt