Address redundant_field_names lint

This commit is contained in:
David Tolnay 2018-09-15 10:03:55 -07:00
parent 1b25db62bb
commit 05eb495917
3 changed files with 5 additions and 10 deletions

View file

@ -5,7 +5,7 @@ matrix:
- rust: stable - rust: stable
- rust: beta - rust: beta
- rust: nightly - rust: nightly
- rust: 1.13.0 - rust: 1.17.0
script: cargo build script: cargo build
- rust: 1.22.1 - rust: 1.22.1
- rust: nightly - rust: nightly

View file

@ -113,10 +113,9 @@ fn escape_str(wr: &mut fmt::Write, v: &str) -> Result<(), fmt::Error> {
impl<'a> YamlEmitter<'a> { impl<'a> YamlEmitter<'a> {
pub fn new(writer: &'a mut fmt::Write) -> YamlEmitter { pub fn new(writer: &'a mut fmt::Write) -> YamlEmitter {
YamlEmitter { YamlEmitter {
writer: writer, writer,
best_indent: 2, best_indent: 2,
compact: true, compact: true,
level: -1, level: -1,
} }
} }

View file

@ -27,11 +27,7 @@ pub struct Marker {
impl Marker { impl Marker {
fn new(index: usize, line: usize, col: usize) -> Marker { fn new(index: usize, line: usize, col: usize) -> Marker {
Marker { Marker { index, line, col }
index: index,
line: line,
col: col,
}
} }
pub fn index(&self) -> usize { pub fn index(&self) -> usize {
@ -135,7 +131,7 @@ impl SimpleKey {
possible: false, possible: false,
required: false, required: false,
token_number: 0, token_number: 0,
mark: mark, mark,
} }
} }
} }
@ -227,7 +223,7 @@ impl<T: Iterator<Item = char>> Scanner<T> {
/// Creates the YAML tokenizer. /// Creates the YAML tokenizer.
pub fn new(rdr: T) -> Scanner<T> { pub fn new(rdr: T) -> Scanner<T> {
Scanner { Scanner {
rdr: rdr, rdr,
buffer: VecDeque::new(), buffer: VecDeque::new(),
mark: Marker::new(0, 1, 0), mark: Marker::new(0, 1, 0),
tokens: VecDeque::new(), tokens: VecDeque::new(),