Skip to content

Commit a0438c4

Browse files
authored
Merge pull request rust-lang#1304 from jyn514/nightly-warnings
Fix nightly warnings
2 parents 0319119 + da315bf commit a0438c4

File tree

4 files changed

+8
-12
lines changed

4 files changed

+8
-12
lines changed

src/docbuilder/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ impl DocBuilder {
2525
pub fn new(config: Arc<Config>, db: Pool, build_queue: Arc<BuildQueue>) -> DocBuilder {
2626
DocBuilder {
2727
config,
28-
build_queue,
2928
db,
29+
build_queue,
3030
}
3131
}
3232

src/utils/github_updater.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,8 @@ impl GithubUpdater {
210210
// When a node is missing (for example if the repository was deleted or made private) the
211211
// GraphQL API will return *both* a `null` instead of the data in the nodes list and a
212212
// `NOT_FOUND` error in the errors list.
213-
for node in &response.data.nodes {
214-
if let Some(node) = node {
215-
self.store_repository(conn, &node)?;
216-
}
213+
for node in response.data.nodes.iter().flatten() {
214+
self.store_repository(conn, &node)?;
217215
}
218216
for error in &response.errors {
219217
use GraphErrorPath::*;

src/web/crate_details.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -60,12 +60,10 @@ fn optional_markdown<S>(markdown: &Option<String>, serializer: S) -> Result<S::O
6060
where
6161
S: Serializer,
6262
{
63-
if let Some(ref markdown) = markdown {
64-
Some(render_markdown(&markdown))
65-
} else {
66-
None
67-
}
68-
.serialize(serializer)
63+
markdown
64+
.as_ref()
65+
.map(|markdown| render_markdown(&markdown))
66+
.serialize(serializer)
6967
}
7068

7169
#[derive(Debug, Clone, Eq, PartialEq, Serialize)]

src/web/page/templates.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ impl ReturnValue {
193193

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

0 commit comments

Comments
 (0)