rust_gd/
separator.rs

1use bitvec::prelude::*;
2use std::convert::From;
3
4pub enum Separator {
5  Deduped,
6  AsIs,
7}
8
9impl From<bool> for Separator {
10  fn from(b: bool) -> Self {
11    if b {
12      Separator::Deduped
13    } else {
14      Separator::AsIs
15    }
16  }
17}
18
19impl Separator {
20  pub fn bv(&self) -> BitVec {
21    match *self {
22      Separator::Deduped => bitvec![1],
23      Self::AsIs => bitvec![0],
24    }
25  }
26}