Fix remove redundant clone

This commit is contained in:
Abdelrahman Omar 2024-09-06 15:06:53 +03:00 committed by GitHub
parent 28d39cb0f4
commit b9462c8159
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -12,7 +12,7 @@ enum TicketNewError {
// When the description is invalid, instead, it should use a default description:
// "Description not provided".
fn easy_ticket(title: String, description: String, status: Status) -> Ticket {
match Ticket::new(title.clone(), description.clone(), status.clone()) {
match Ticket::new(title.clone(), description, status.clone()) {
Ok(ticket) => ticket,
Err(TicketNewError::DescriptionError(_)) => {
Ticket::new(title, "Description not provided".to_string(), status).unwrap()