[bugpoint] Cosmetic improvements;

- Mostly Rust improvements to make code look more idiomatic.
- Also reuses the code memory accross compilation, to avoid many
memory allocations.
This commit is contained in:
Benjamin Bouvier
2019-10-11 16:44:40 +02:00
parent 48ccb3e051
commit a5efd2a625
2 changed files with 56 additions and 73 deletions

View File

@@ -9,7 +9,7 @@ pub struct PrintRelocs {
}
impl PrintRelocs {
pub fn new(flag_print: bool) -> PrintRelocs {
pub fn new(flag_print: bool) -> Self {
Self {
flag_print,
text: String::new(),
@@ -80,7 +80,7 @@ pub struct PrintTraps {
}
impl PrintTraps {
pub fn new(flag_print: bool) -> PrintTraps {
pub fn new(flag_print: bool) -> Self {
Self {
flag_print,
text: String::new(),
@@ -102,7 +102,7 @@ pub struct PrintStackmaps {
}
impl PrintStackmaps {
pub fn new(flag_print: bool) -> PrintStackmaps {
pub fn new(flag_print: bool) -> Self {
Self {
flag_print,
text: String::new(),