word_cloud/geometry/orientation.rs
1use rand::Rng;
2
3#[derive(PartialEq, Debug)]
4pub enum Orientation {
5 Horizontal,
6 Vertical,
7}
8
9impl Clone for Orientation {
10 fn clone(&self) -> Self {
11 match self {
12 Self::Horizontal => Self::Horizontal,
13 Self::Vertical => Self::Vertical,
14 }
15 }
16}
17
18impl Orientation {
19 pub fn random() -> Self {
20 match rand::thread_rng().gen_bool(0.80) {
21 true => Self::Horizontal,
22 false => Self::Vertical,
23 }
24 }
25}