From 1f9710308f6823df69d8a7eab582b861c2cd5c96 Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Sun, 28 Apr 2019 12:59:27 +0200 Subject: [PATCH] Add missing core::fmt::{self, Write} imports in testing post --- blog/content/second-edition/posts/04-testing/index.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/blog/content/second-edition/posts/04-testing/index.md b/blog/content/second-edition/posts/04-testing/index.md index d6d16989..f94e48e3 100644 --- a/blog/content/second-edition/posts/04-testing/index.md +++ b/blog/content/second-edition/posts/04-testing/index.md @@ -923,6 +923,8 @@ Checking the reported panic message is a bit more complicated. The reason is tha ```rust // in tests/panic_handler.rs +use core::fmt; + /// Compares a `fmt::Arguments` instance with the `MESSAGE` string. /// /// To use this type, write the `fmt::Arguments` instance to it using the @@ -956,6 +958,8 @@ With the `CompareMessage` type, we can finally implement our `check_message` fun #![feature(panic_info_message)] // at the top of the file +use core::fmt::Write; + fn check_message(info: &PanicInfo) { let message = info.message().unwrap_or_else(|| fail("no message")); let mut compare_message = CompareMessage { equals: false };