Skip to content

Commit 6491fce

Browse files
committed
Add SimplificationFlags for table validation.
1 parent 71c2b70 commit 6491fce

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/simplification_flags.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,20 @@ bitflags! {
44
/// Boolean flags affecting simplification
55
/// behavior.
66
///
7-
/// Currently, this is unused, and exists
8-
/// as a placeholder for the future.
9-
///
107
/// # Example
118
///
129
/// ```
1310
/// let e = forrustts::SimplificationFlags::empty();
14-
/// assert!(e.contains(forrustts::SimplificationFlags::NONE));
11+
/// assert_eq!(e.bits(), 0);
1512
/// ```
1613
#[derive(Default)]
1714
pub struct SimplificationFlags: u32 {
18-
/// Placeholder
19-
const NONE = 0;
15+
/// Validate that input edges are sorted
16+
const VALIDATE_EDGES = 1 << 0;
17+
/// Validate that input mutations are sorted
18+
const VALIDATE_MUTATIONS = 1 << 1;
19+
/// Validate all tables.
20+
const VALIDATE_ALL = Self::VALIDATE_EDGES.bits | Self::VALIDATE_MUTATIONS.bits;
2021
}
2122
}
2223

@@ -27,7 +28,6 @@ mod test {
2728
#[test]
2829
fn test_empty() {
2930
let e = SimplificationFlags::empty();
30-
assert!(e.contains(SimplificationFlags::NONE));
3131
assert_eq!(e.bits(), 0);
3232
}
3333
}

0 commit comments

Comments
 (0)