Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

Commit

Permalink
Rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Nov 8, 2017
1 parent 9c88977 commit caf0426
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 131 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
target
.idea
*.iml

.vscode/
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 11 additions & 14 deletions src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@ impl Pattern {
Ok(Pattern(chunks))
}

pub fn display<'a>(&'a self,
package: &'a PackageId,
metadata: &'a ManifestMetadata)
-> Display<'a> {
pub fn display<'a>(
&'a self,
package: &'a PackageId,
metadata: &'a ManifestMetadata,
) -> Display<'a> {
Display {
pattern: self,
package: package,
Expand All @@ -61,16 +62,12 @@ impl<'a> fmt::Display for Display<'a> {
match *chunk {
Chunk::Raw(ref s) => try!(fmt.write_str(s)),
Chunk::Package => try!(write!(fmt, "{}", self.package)),
Chunk::License => {
if let Some(ref license) = self.metadata.license {
try!(write!(fmt, "{}", license))
}
}
Chunk::Repository => {
if let Some(ref repository) = self.metadata.repository {
try!(write!(fmt, "{}", repository))
}
}
Chunk::License => if let Some(ref license) = self.metadata.license {
try!(write!(fmt, "{}", license))
},
Chunk::Repository => if let Some(ref repository) = self.metadata.repository {
try!(write!(fmt, "{}", repository))
},
}
}

Expand Down
Loading

0 comments on commit caf0426

Please sign in to comment.