Use Self instead of repeating the type name.

This commit is contained in:
Dan Gohman
2017-11-08 10:40:47 -08:00
parent b7f979a8be
commit 3ab4349c1b
41 changed files with 105 additions and 105 deletions

View File

@@ -35,8 +35,8 @@ struct TextSink {
impl TextSink {
/// Create a new empty TextSink.
pub fn new(isa: &TargetIsa) -> TextSink {
TextSink {
pub fn new(isa: &TargetIsa) -> Self {
Self {
rnames: isa.reloc_names(),
offset: 0,
text: String::new(),

View File

@@ -38,7 +38,7 @@ pub struct ConcurrentRunner {
impl ConcurrentRunner {
/// Create a new `ConcurrentRunner` with threads spun up.
pub fn new() -> ConcurrentRunner {
pub fn new() -> Self {
let (request_tx, request_rx) = channel();
let request_mutex = Arc::new(Mutex::new(request_rx));
let (reply_tx, reply_rx) = channel();
@@ -51,7 +51,7 @@ impl ConcurrentRunner {
})
.collect();
ConcurrentRunner {
Self {
request_tx: Some(request_tx),
reply_rx,
handles,

View File

@@ -81,8 +81,8 @@ pub struct TestRunner {
impl TestRunner {
/// Create a new blank TrstRunner.
pub fn new(verbose: bool) -> TestRunner {
TestRunner {
pub fn new(verbose: bool) -> Self {
Self {
verbose,
dir_stack: Vec::new(),
tests: Vec::new(),