completed most of 05 ticket v2

This commit is contained in:
2025-03-17 06:39:58 +05:30
parent 8d1342c831
commit 8413518a84
14 changed files with 132 additions and 27 deletions

View File

@@ -9,7 +9,7 @@ struct Ticket {
status: Status,
}
#[derive(Debug, PartialEq)]
#[derive(Debug, PartialEq, Clone)]
enum Status {
ToDo,
InProgress { assigned_to: String },
@@ -38,7 +38,11 @@ impl Ticket {
}
}
pub fn assigned_to(&self) -> &str {
todo!()
match &self.status {
Status::InProgress { assigned_to } => assigned_to,
_ => panic!("Only `In-Progress` tickets can be assigned to someone"),
}
// let Status::InProgress { assigned_to } = self.status;
}
}