1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
use crate::faker::company::raw::*;
use crate::faker::name::raw::LastName;
use crate::locales::Data;
use crate::{Dummy, Fake};
use rand::seq::SliceRandom;
use rand::Rng;
impl<L: Data> Dummy<CompanySuffix<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &CompanySuffix<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_SUFFIX.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<CompanySuffix<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &CompanySuffix<L>, rng: &mut R) -> Self {
*L::COMPANY_SUFFIX.choose(rng).unwrap()
}
}
impl<L: Data + Copy> Dummy<CompanyName<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(c: &CompanyName<L>, rng: &mut R) -> Self {
let name_tpl = *L::COMPANY_NAME_TPLS.choose(rng).unwrap();
name_tpl
.replace("{Name_1}", LastName(c.0).fake_with_rng::<&str, _>(rng))
.replace("{Name_2}", LastName(c.0).fake_with_rng::<&str, _>(rng))
.replace("{Suffix}", CompanySuffix(c.0).fake_with_rng::<&str, _>(rng))
}
}
impl<L: Data> Dummy<Buzzword<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Buzzword<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_BUZZWORD_HEAD.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<Buzzword<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Buzzword<L>, rng: &mut R) -> Self {
*L::COMPANY_BUZZWORD_HEAD.choose(rng).unwrap()
}
}
impl<L: Data> Dummy<BuzzwordMiddle<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BuzzwordMiddle<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_BUZZWORD_MIDDLE.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<BuzzwordMiddle<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BuzzwordMiddle<L>, rng: &mut R) -> Self {
*L::COMPANY_BUZZWORD_MIDDLE.choose(rng).unwrap()
}
}
impl<L: Data> Dummy<BuzzwordTail<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BuzzwordTail<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_BUZZWORD_TAIL.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<BuzzwordTail<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BuzzwordTail<L>, rng: &mut R) -> Self {
*L::COMPANY_BUZZWORD_TAIL.choose(rng).unwrap()
}
}
impl<L: Data + Copy> Dummy<CatchPhase<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(c: &CatchPhase<L>, rng: &mut R) -> Self {
L::COMPANY_CATCH_PHASE_TPL
.replace("{Head}", Buzzword(c.0).fake_with_rng::<&str, _>(rng))
.replace(
"{Middle}",
BuzzwordMiddle(c.0).fake_with_rng::<&str, _>(rng),
)
.replace("{Tail}", BuzzwordTail(c.0).fake_with_rng::<&str, _>(rng))
}
}
impl<L: Data> Dummy<BsVerb<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BsVerb<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_BS_VERBS.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<BsVerb<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BsVerb<L>, rng: &mut R) -> Self {
*L::COMPANY_BS_VERBS.choose(rng).unwrap()
}
}
impl<L: Data> Dummy<BsAdj<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BsAdj<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_BS_ADJ.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<BsAdj<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BsAdj<L>, rng: &mut R) -> Self {
*L::COMPANY_BS_ADJ.choose(rng).unwrap()
}
}
impl<L: Data> Dummy<BsNoun<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BsNoun<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_BS_NOUNS.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<BsNoun<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &BsNoun<L>, rng: &mut R) -> Self {
*L::COMPANY_BS_NOUNS.choose(rng).unwrap()
}
}
impl<L: Data + Copy> Dummy<Bs<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(c: &Bs<L>, rng: &mut R) -> Self {
L::COMPANY_BS_TPL
.replace("{Verb}", BsVerb(c.0).fake_with_rng::<&str, _>(rng))
.replace("{Adj}", BsAdj(c.0).fake_with_rng::<&str, _>(rng))
.replace("{Noun}", BsNoun(c.0).fake_with_rng::<&str, _>(rng))
}
}
impl<L: Data> Dummy<Profession<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Profession<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_PROFESSION.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<Profession<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Profession<L>, rng: &mut R) -> Self {
*L::COMPANY_PROFESSION.choose(rng).unwrap()
}
}
impl<L: Data> Dummy<Industry<L>> for String {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Industry<L>, rng: &mut R) -> Self {
let s = *L::COMPANY_INDUSTRY.choose(rng).unwrap();
s.into()
}
}
impl<L: Data> Dummy<Industry<L>> for &str {
fn dummy_with_rng<R: Rng + ?Sized>(_: &Industry<L>, rng: &mut R) -> Self {
*L::COMPANY_INDUSTRY.choose(rng).unwrap()
}
}