Simplify constructor functions

This commit is contained in:
Patrick Förster 2020-01-08 19:20:16 +01:00
parent da999c1d08
commit 9dd6dbdc59
3 changed files with 4 additions and 4 deletions

View file

@ -155,7 +155,7 @@ struct BibtexContentAnalyzer<'a> {
impl<'a> BibtexContentAnalyzer<'a> {
pub fn new() -> Self {
BibtexContentAnalyzer { tokens: Vec::new() }
Self { tokens: Vec::new() }
}
}

View file

@ -17,7 +17,7 @@ pub struct Workspace {
impl Workspace {
pub fn new() -> Self {
Workspace {
Self {
documents: Vec::new(),
}
}

View file

@ -92,7 +92,7 @@ pub struct BuildError {
impl BuildError {
pub fn new(uri: Uri, kind: BuildErrorKind, message: String, line: Option<u64>) -> Self {
BuildError {
Self {
uri,
kind,
message,
@ -264,7 +264,7 @@ struct FileRange {
impl FileRange {
fn new(uri: Option<Uri>, start: usize, end: usize) -> Self {
FileRange { uri, start, end }
Self { uri, start, end }
}
fn length(&self) -> usize {