Skip to content

Commit

Permalink
Remove deadcode & use &str instead &String
Browse files Browse the repository at this point in the history
Signed-off-by: Muhammad Mahad <[email protected]>
  • Loading branch information
MahadMuhammad committed Aug 1, 2024
1 parent 96b3bdb commit 742b8e1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
2 changes: 1 addition & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub fn parse_arguments_and_read_file(args: &Arguments) -> Result<(String, Option
Ok((source_code, err_file))
}

pub fn print_source_code(source_code: &String) {
pub fn print_source_code(source_code: &str) {
println!("{source_code}");
}

Expand Down
26 changes: 0 additions & 26 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,32 +91,6 @@ impl fmt::Display for Error {
format!(".{} ", self.relative_line_num)
},
)
// let error_code = self.error_code.as_ref().map_or("", |code| &code[..]);
// write!(
// f,
// "// {{ {} \"{}{}\" \"\" {{ target *-*-* }} {}}}",
// match &self.kind {
// Some(kind) => match kind {
// RustcErrorKind::Help => "help",
// RustcErrorKind::Error => "dg-error",
// RustcErrorKind::Note => "dg-note",
// RustcErrorKind::Suggestion => "suggestion",
// RustcErrorKind::Warning => "dg-warning",
// },
// None => "dg-error",
// },
// self.msg,
// if !error_code.is_empty() {
// format!(" .{}.", error_code)
// } else {
// error_code.to_owned()
// },
// if self.relative_line_num == 0 {
// "".to_owned()
// } else {
// format!(".{} ", self.relative_line_num)
// },
// )
}
}

Expand Down

0 comments on commit 742b8e1

Please sign in to comment.