c3-linearization

Crates.ioc3-linearization
lib.rsc3-linearization
version0.1.0
sourcesrc
created_at2020-11-11 07:19:42.81988
updated_at2020-11-11 07:19:42.81988
descriptionC3 linearization
homepage
repositoryhttps://github.com/GalAster/c3-linearization
max_upload_size
id311128
size31,677
SasakiSaki (oovm)

documentation

README

C3 Linearization

use std::collections::HashMap;
use c3_linearization::C3;

#[test]
fn basic() {
    let c3 = C3::default();
    let mut input = HashMap::new();
    input.insert('A', vec!['B', 'C']);
    input.insert('B', vec![]);
    input.insert('C', vec!['D']);
    input.insert('D', vec![]);
    let mut target = HashMap::new();
    target.insert('A', vec!['A', 'B', 'C', 'D']);
    target.insert('B', vec!['B']);
    target.insert('C', vec!['C', 'D']);
    target.insert('D', vec!['D']);
    assert_eq!(target, c3.linearize(input).unwrap())
}
Commit count: 3

cargo fmt