Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oovm/c3-linearization
C3 Linearization in scala/ruby style
https://github.com/oovm/c3-linearization
algorithm c3 mro
Last synced: about 2 months ago
JSON representation
C3 Linearization in scala/ruby style
- Host: GitHub
- URL: https://github.com/oovm/c3-linearization
- Owner: oovm
- License: mpl-2.0
- Created: 2020-11-10T13:13:01.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-06-17T13:10:25.000Z (8 months ago)
- Last Synced: 2024-11-19T14:56:14.192Z (3 months ago)
- Topics: algorithm, c3, mro
- Language: Rust
- Homepage:
- Size: 42 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License.md
Awesome Lists containing this project
README
C3 Linearization
================```rust
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())
}
```