Skip to content

Fix collecting github stats after timezone-migration #1235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/font-awesome-as-a-crate/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ Get a fontawesome svg file by its name.
*/
pub fn svg(type_: Type, name: &str) -> Result<&'static str, NameError> {
let svg = fontawesome_svg(type_.as_str(), name);
if svg == "" {
if svg.is_empty() {
return Err(NameError);
}
Ok(svg)
Expand Down
2 changes: 1 addition & 1 deletion src/utils/github_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ impl GithubUpdater {
&repo.id,
&repo.name_with_owner,
&repo.description,
&repo.pushed_at.map(|time| time.naive_utc()),
&repo.pushed_at,
&(repo.stargazer_count as i32),
&(repo.fork_count as i32),
&(repo.issues.total_count as i32),
Expand Down
6 changes: 3 additions & 3 deletions src/web/rustdoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
.recently_accessed_releases
.record(krate.crate_id, krate.release_id, target);

let target = if target == "" {
let target = if target.is_empty() {
String::new()
} else {
format!("{}/", target)
Expand Down Expand Up @@ -656,7 +656,7 @@ mod test {
use crate::test::*;
use kuchiki::traits::TendrilSink;
use reqwest::StatusCode;
use std::{collections::BTreeMap, iter::FromIterator};
use std::collections::BTreeMap;

fn try_latest_version_redirect(
path: &str,
Expand Down Expand Up @@ -1175,7 +1175,7 @@ mod test {
path: &str,
links: &[(&str, &str)],
) -> Result<(), failure::Error> {
let mut links = BTreeMap::from_iter(links.iter().copied());
let mut links: BTreeMap<_, _> = links.iter().copied().collect();

for (platform, link, rel) in get_platform_links(path, web)? {
assert_eq!(rel, "nofollow");
Expand Down