Fix: `recv` returns an `Option<Ticket>`
authorLukeMathWalker <20745048+LukeMathWalker@users.noreply.github.com>
Mon, 13 May 2024 18:30:01 +0000 (20:30 +0200)
committerLukeMathWalker <20745048+LukeMathWalker@users.noreply.github.com>
Mon, 13 May 2024 18:30:01 +0000 (20:30 +0200)
exercises/07_threads/07_ack/tests/insert.rs

index 6e249ba..85eb143 100644 (file)
@@ -34,7 +34,10 @@ fn insert_works() {
         .send(command)
         .expect("Did you actually spawn a thread? The channel is closed!");
 
-    let ticket: Ticket = response_receiver.recv().expect("No response received!");
+    let ticket: Ticket = response_receiver
+        .recv()
+        .expect("No response received!")
+        .unwrap();
     assert_eq!(ticket_id, ticket.id);
     assert_eq!(ticket.status, Status::ToDo);
     assert_eq!(ticket.title, draft.title);