rust-faker 0.1.5

create fake data with rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{Name};
use std::io::Result as IoResult;

pub fn create_names(first_name: &'static str, last_name: &'static str, loop_by: i32) -> IoResult<Vec<Name>> {
  Ok((0..loop_by).map(|_| Name{first_name: first_name.to_string(), last_name: last_name.to_string() }).collect())
}

pub fn create_name(first_name: &'static str, last_name: &'static str) -> IoResult<Name> {
  Ok(Name{
    first_name: first_name.to_string(),
    last_name: last_name.to_string(),
  })
}