From 896a7306ee36a4c7dc96e1bf61e247e53df47179 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Mon, 19 Feb 2024 09:31:47 -0800 Subject: [PATCH] Eliminate glob imports from examples --- examples/dump-syntax/src/main.rs | 8 +++----- examples/heapsize/heapsize/src/lib.rs | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/examples/dump-syntax/src/main.rs b/examples/dump-syntax/src/main.rs index 855047a025..a4cdfd92cb 100644 --- a/examples/dump-syntax/src/main.rs +++ b/examples/dump-syntax/src/main.rs @@ -39,12 +39,10 @@ enum Error { impl Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - use self::Error::*; - match self { - IncorrectUsage => write!(f, "Usage: dump-syntax path/to/filename.rs"), - ReadFile(error) => write!(f, "Unable to read file: {}", error), - ParseFile { + Error::IncorrectUsage => write!(f, "Usage: dump-syntax path/to/filename.rs"), + Error::ReadFile(error) => write!(f, "Unable to read file: {}", error), + Error::ParseFile { error, filepath, source_code, diff --git a/examples/heapsize/heapsize/src/lib.rs b/examples/heapsize/heapsize/src/lib.rs index 30bb6d606f..240d10db93 100644 --- a/examples/heapsize/heapsize/src/lib.rs +++ b/examples/heapsize/heapsize/src/lib.rs @@ -1,6 +1,6 @@ use std::mem; -pub use heapsize_derive::*; +pub use heapsize_derive::HeapSize; pub trait HeapSize { /// Total number of bytes of heap memory owned by `self`.