Skip to content

Commit 86c814d

Browse files
committed
update if / if-let in rustdoc
1 parent 0e77ebb commit 86c814d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/web/rustdoc.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ impl RustdocPage {
284284

285285
let mut response = Response::with((Status::Ok, html));
286286
response.headers.set(ContentType::html());
287-
if let Some(cache_control) = if is_latest_url {
287+
288+
let cache_control = if is_latest_url {
288289
generate_cache_directives_for(
289290
Some(config.cache_control_max_age_latest.unwrap_or(0)),
290291
config.cache_control_stale_while_revalidate_latest,
@@ -294,7 +295,8 @@ impl RustdocPage {
294295
config.cache_control_max_age,
295296
config.cache_control_stale_while_revalidate,
296297
)
297-
} {
298+
};
299+
if let Some(cache_control) = cache_control {
298300
response.headers.set(cache_control);
299301
}
300302
Ok(response)

0 commit comments

Comments
 (0)