Use more Self keywords instead of repeating the type name.

This commit is contained in:
Dan Gohman
2018-10-05 16:40:50 -07:00
parent 9a1e966156
commit 17a9631981
16 changed files with 40 additions and 58 deletions

View File

@@ -117,8 +117,8 @@ struct Context<'a> {
}
impl<'a> Context<'a> {
fn new(f: Function, unique_isa: Option<&'a TargetIsa>) -> Context<'a> {
Context {
fn new(f: Function, unique_isa: Option<&'a TargetIsa>) -> Self {
Self {
function: f,
map: SourceMap::new(),
unique_isa,
@@ -309,8 +309,8 @@ impl<'a> Context<'a> {
impl<'a> Parser<'a> {
/// Create a new `Parser` which reads `text`. The referenced text must outlive the parser.
pub fn new(text: &'a str) -> Parser {
Parser {
pub fn new(text: &'a str) -> Self {
Self {
lex: Lexer::new(text),
lex_error: None,
lookahead: None,