blob: 0558395f1e30f33132440f7a3f911c4fb11f8c8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
use faker_rand::{
en_us::{addresses::CityName, names::FullName},
faker_impl_from_templates,
};
use rand;
use crate::{app::App, repo::channel::Channel};
pub async fn create(app: &App) -> Channel {
let name = propose();
app.channels()
.create(&name)
.await
.expect("should always succeed if the channel is actually new")
}
pub fn propose() -> String {
rand::random::<Name>().to_string()
}
struct Name(String);
faker_impl_from_templates! {
Name; "{} {}", CityName, FullName;
}
|