Bug 1488006: mozprofile: avoid redundant field names in struct init; r=jgraham

This commit is contained in:
Andreas Tolfsen 2018-09-01 16:35:36 +01:00
parent 6064b9610a
commit 4cf5f38cc9
2 changed files with 10 additions and 13 deletions

View File

@ -17,9 +17,9 @@ impl PrefReaderError {
parent: Option<Box<Error>>,
) -> PrefReaderError {
PrefReaderError {
message: message,
position: position,
parent: parent,
message,
position,
parent,
}
}
}
@ -157,11 +157,11 @@ struct TokenData<'a> {
impl<'a> TokenData<'a> {
fn new(token_type: TokenType, position: Position, start_pos: usize) -> TokenData<'a> {
TokenData {
token_type: token_type,
token_type,
complete: false,
position: position,
position,
data: Cow::Borrowed(""),
start_pos: start_pos,
start_pos,
}
}
@ -213,7 +213,7 @@ pub struct PrefTokenizer<'a> {
impl<'a> PrefTokenizer<'a> {
pub fn new(data: &'a [u8]) -> PrefTokenizer<'a> {
PrefTokenizer {
data: data,
data,
pos: 0,
cur: None,
position: Position::new(),

View File

@ -29,8 +29,8 @@ impl Profile {
};
Ok(Profile {
path: path,
temp_dir: temp_dir,
path,
temp_dir,
prefs: None,
user_prefs: None,
})
@ -74,10 +74,7 @@ impl PrefFile {
parse(buf.as_bytes())?
};
Ok(PrefFile {
path: path,
prefs: prefs,
})
Ok(PrefFile { path, prefs })
}
pub fn write(&self) -> IoResult<()> {