Skip to content

Commit

Permalink
Apply rustfmt :(
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Mar 1, 2020
1 parent 515446c commit 96b3261
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
19 changes: 5 additions & 14 deletions src/librustc_parse/parser/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,25 +41,15 @@ pub(super) fn dummy_arg(ident: Ident) -> Param {
}

pub enum Error {
FileNotFoundForModule {
mod_name: String,
default_path: PathBuf,
},
DuplicatePaths {
mod_name: String,
default_path: String,
secondary_path: String,
},
FileNotFoundForModule { mod_name: String, default_path: PathBuf },
DuplicatePaths { mod_name: String, default_path: String, secondary_path: String },
UselessDocComment,
}

impl Error {
fn span_err(self, sp: impl Into<MultiSpan>, handler: &Handler) -> DiagnosticBuilder<'_> {
match self {
Error::FileNotFoundForModule {
ref mod_name,
ref default_path,
} => {
Error::FileNotFoundForModule { ref mod_name, ref default_path } => {
let mut err = struct_span_err!(
handler,
sp,
Expand All @@ -69,7 +59,8 @@ impl Error {
);
err.help(&format!(
"to create the module `{}`, create file \"{}\"",
mod_name, default_path.display(),
mod_name,
default_path.display(),
));
err
}
Expand Down
7 changes: 3 additions & 4 deletions src/librustc_parse/parser/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,9 @@ impl<'a> Parser<'a> {
path: secondary_path,
directory_ownership: DirectoryOwnership::Owned { relative: None },
}),
(false, false) => Err(Error::FileNotFoundForModule {
mod_name: mod_name.clone(),
default_path,
}),
(false, false) => {
Err(Error::FileNotFoundForModule { mod_name: mod_name.clone(), default_path })
}
(true, true) => Err(Error::DuplicatePaths {
mod_name: mod_name.clone(),
default_path: default_path_str,
Expand Down

0 comments on commit 96b3261

Please sign in to comment.