Skip to content

Commit

Permalink
Simplify constructor functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pfoerster committed Jan 8, 2020
1 parent da999c1 commit 9dd6dbd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion crates/texlab_syntax/src/bibtex/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ struct BibtexContentAnalyzer<'a> {

impl<'a> BibtexContentAnalyzer<'a> {
pub fn new() -> Self {
BibtexContentAnalyzer { tokens: Vec::new() }
Self { tokens: Vec::new() }
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/texlab_workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct Workspace {

impl Workspace {
pub fn new() -> Self {
Workspace {
Self {
documents: Vec::new(),
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/diagnostics/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 9dd6dbd

Please sign in to comment.