Skip to content

Commit

Permalink
chore: impl Display for DebugType (#2258)
Browse files Browse the repository at this point in the history
impl Display for DebugType
  • Loading branch information
jfecher authored Aug 10, 2023
1 parent 8cf97a4 commit 756e1d9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/noirc_frontend/src/hir/def_collector/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use thiserror::Error;

use std::fmt;

#[derive(Debug)]
pub enum DuplicateType {
Function,
Module,
Expand All @@ -18,7 +19,7 @@ pub enum DuplicateType {

#[derive(Error, Debug)]
pub enum DefCollectorErrorKind {
#[error("duplicate {typ:?} found in namespace")]
#[error("duplicate {typ} found in namespace")]
Duplicate { typ: DuplicateType, first_def: Ident, second_def: Ident },
#[error("unresolved import")]
UnresolvedModuleDecl { mod_name: Ident },
Expand All @@ -36,7 +37,7 @@ impl DefCollectorErrorKind {
}
}

impl fmt::Debug for DuplicateType {
impl fmt::Display for DuplicateType {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DuplicateType::Function => write!(f, "function"),
Expand All @@ -53,7 +54,7 @@ impl From<DefCollectorErrorKind> for Diagnostic {
match error {
DefCollectorErrorKind::Duplicate { typ, first_def, second_def } => {
let primary_message = format!(
"duplicate definitions of {:?} with name {} found",
"duplicate definitions of {} with name {} found",
&typ, &first_def.0.contents
);
{
Expand Down

0 comments on commit 756e1d9

Please sign in to comment.