Skip to content

Commit

Permalink
Merge pull request #1304 from jyn514/nightly-warnings
Browse files Browse the repository at this point in the history
Fix nightly warnings
  • Loading branch information
jyn514 authored Mar 11, 2021
2 parents 0319119 + da315bf commit a0438c4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/docbuilder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ impl DocBuilder {
pub fn new(config: Arc<Config>, db: Pool, build_queue: Arc<BuildQueue>) -> DocBuilder {
DocBuilder {
config,
build_queue,
db,
build_queue,
}
}

Expand Down
6 changes: 2 additions & 4 deletions src/utils/github_updater.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,8 @@ impl GithubUpdater {
// When a node is missing (for example if the repository was deleted or made private) the
// GraphQL API will return *both* a `null` instead of the data in the nodes list and a
// `NOT_FOUND` error in the errors list.
for node in &response.data.nodes {
if let Some(node) = node {
self.store_repository(conn, &node)?;
}
for node in response.data.nodes.iter().flatten() {
self.store_repository(conn, &node)?;
}
for error in &response.errors {
use GraphErrorPath::*;
Expand Down
10 changes: 4 additions & 6 deletions src/web/crate_details.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ fn optional_markdown<S>(markdown: &Option<String>, serializer: S) -> Result<S::O
where
S: Serializer,
{
if let Some(ref markdown) = markdown {
Some(render_markdown(&markdown))
} else {
None
}
.serialize(serializer)
markdown
.as_ref()
.map(|markdown| render_markdown(&markdown))
.serialize(serializer)
}

#[derive(Debug, Clone, Eq, PartialEq, Serialize)]
Expand Down
2 changes: 1 addition & 1 deletion src/web/page/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ impl ReturnValue {

impl tera::Function for ReturnValue {
fn call(&self, args: &HashMap<String, Value>) -> TeraResult<Value> {
debug_assert!(args.is_empty(), format!("{} takes no args", self.name));
debug_assert!(args.is_empty(), "{} takes no args", self.name);
Ok(self.value.clone())
}
}
Expand Down

0 comments on commit a0438c4

Please sign in to comment.