Compare commits
1 Commits
exercises/
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| d1ce16c0e7 |
@@ -1,28 +0,0 @@
|
|||||||
#[derive(Debug)]
|
|
||||||
pub struct Employee {
|
|
||||||
name: String,
|
|
||||||
department: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Employee {
|
|
||||||
pub fn new(name: &str, department: &str) -> Self {
|
|
||||||
self::Employee {
|
|
||||||
name: name.to_string(),
|
|
||||||
department: department.to_string(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct Employees {
|
|
||||||
employees: Vec<Employee>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
mod test {
|
|
||||||
use super::*;
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn new_employee() {
|
|
||||||
println!("{:?}", Employee::new("Amir", "Sales"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
mod stats;
|
mod stats;
|
||||||
mod pig_latin;
|
mod pig_latin;
|
||||||
mod employee_interface;
|
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
// Stats
|
// Stats
|
||||||
|
|||||||
Reference in New Issue
Block a user