Adding initial
This commit is contained in:
21
src/employee_interface.rs
Normal file
21
src/employee_interface.rs
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Employee {
|
||||||
|
name: &str,
|
||||||
|
department: &str,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Employee {
|
||||||
|
pub fn new(name: &str, department: &str) -> Self {
|
||||||
|
self::Employee { name, department }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
mod test {
|
||||||
|
#[test]
|
||||||
|
fn new_employee() {
|
||||||
|
println!(Employee::new("Amir", "Sales"))
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
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