Skip to content

Commit

Permalink
Fix Clippy warnings (#886)
Browse files Browse the repository at this point in the history
This addresses the following Clippy warnings:

* clippy::option_and_then_some
* clippy::useless_format
  • Loading branch information
samford authored and Keats committed Dec 19, 2019
1 parent d61e3dd commit b83321f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/front_matter/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ impl PageFrontMatter {
pub fn date_to_datetime(&mut self) {
self.datetime = if let Some(ref d) = self.date {
if d.contains('T') {
DateTime::parse_from_rfc3339(&d).ok().and_then(|s| Some(s.naive_local()))
DateTime::parse_from_rfc3339(&d).ok().map(|s| s.naive_local())
} else {
NaiveDate::parse_from_str(&d, "%Y-%m-%d")
.ok()
.and_then(|s| Some(s.and_hms(0, 0, 0)))
.map(|s| s.and_hms(0, 0, 0))
}
} else {
None
Expand Down
2 changes: 1 addition & 1 deletion components/library/src/pagination/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl<'a> Paginator<'a> {
}
paginator.insert("number_pagers", to_value(&self.pagers.len()).unwrap());
let base_url = if self.paginate_path.is_empty() {
format!("{}", self.permalink)
self.permalink.to_string()
} else {
format!("{}{}/", self.permalink, self.paginate_path)
};
Expand Down

0 comments on commit b83321f

Please sign in to comment.