Skip to content

Commit d173180

Browse files
committed
Auto merge of #58266 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 11 pull requests Successful merges: - #57504 (Re-enable history api on file:// protocol) - #57848 (Generate a documentation page for core::mem::transmute.) - #57884 (Update minifier version) - #57954 (rustdoc: remove blank unstable spans) - #58028 (Fix image link in the settings menu) - #58033 (rustdoc: wrap stability tags in colored spans) - #58086 ([rustdoc] Improve file list display) - #58143 (Sort elements in the sidebar) - #58146 (Prevent automatic collapse of methods impl blocks) - #58150 (Don't apply impl block collapse rules to trait impls) - #58185 (Remove images' url to make it work even without internet connection) Failed merges: r? @ghost
2 parents ad43389 + 761caa2 commit d173180

File tree

51 files changed

+240
-244
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+240
-244
lines changed

Cargo.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1503,7 +1503,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
15031503

15041504
[[package]]
15051505
name = "minifier"
1506-
version = "0.0.26"
1506+
version = "0.0.28"
15071507
source = "registry+https://github.com/rust-lang/crates.io-index"
15081508
dependencies = [
15091509
"macro-utils 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2992,7 +2992,7 @@ dependencies = [
29922992
name = "rustdoc"
29932993
version = "0.0.0"
29942994
dependencies = [
2995-
"minifier 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)",
2995+
"minifier 0.0.28 (registry+https://github.com/rust-lang/crates.io-index)",
29962996
"parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)",
29972997
"pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
29982998
"tempfile 3.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -4066,7 +4066,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
40664066
"checksum memchr 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0a3eb002f0535929f1199681417029ebea04aadc0c7a4224b46be99c7f5d6a16"
40674067
"checksum memmap 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff"
40684068
"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3"
4069-
"checksum minifier 0.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f299df45afd73332044ea9f717c816a84fc90c8b631409abf339ba93642a7985"
4069+
"checksum minifier 0.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "3a2898502751dcc9d66b6fff57f3cf63cc91605e83e1a33515396f5027f8e4ca"
40704070
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
40714071
"checksum miniz_oxide 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5ad30a47319c16cde58d0314f5d98202a80c9083b5f61178457403dfb14e509c"
40724072
"checksum miniz_oxide_c_api 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "28edaef377517fd9fe3e085c37d892ce7acd1fbeab9239c5a36eec352d8a8b7e"

src/liballoc/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@
5555
reason = "this library is unlikely to be stabilized in its current \
5656
form or name",
5757
issue = "27783")]
58-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
59-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
60-
html_root_url = "https://doc.rust-lang.org/nightly/",
58+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
6159
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
6260
test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
6361
#![no_std]

src/libarena/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
//! This crate implements `TypedArena`, a simple arena that can only hold
99
//! objects of a single type.
1010
11-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
12-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
13-
html_root_url = "https://doc.rust-lang.org/nightly/",
11+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1412
test(no_crate_inject, attr(deny(warnings))))]
1513

1614
#![feature(alloc)]

src/libcore/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,7 @@
5151
#![cfg(not(test))]
5252

5353
#![stable(feature = "core", since = "1.6.0")]
54-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
55-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
56-
html_root_url = "https://doc.rust-lang.org/nightly/",
54+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
5755
html_playground_url = "https://play.rust-lang.org/",
5856
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
5957
test(no_crate_inject, attr(deny(warnings))),

src/libcore/mem.rs

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use ptr;
1515
use ops::{Deref, DerefMut};
1616

1717
#[stable(feature = "rust1", since = "1.0.0")]
18+
#[doc(inline)]
1819
pub use intrinsics::transmute;
1920

2021
/// Takes ownership and "forgets" about the value **without running its destructor**.

src/libfmt_macros/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
//! Parsing does not happen at runtime: structures of `std::fmt::rt` are
55
//! generated instead.
66
7-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
8-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
9-
html_root_url = "https://doc.rust-lang.org/nightly/",
7+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
108
html_playground_url = "https://play.rust-lang.org/",
119
test(attr(deny(warnings))))]
1210

src/libgraphviz/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,7 @@
271271
//!
272272
//! * [DOT language](http://www.graphviz.org/doc/info/lang.html)
273273
274-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
275-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
276-
html_root_url = "https://doc.rust-lang.org/nightly/",
274+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
277275
test(attr(allow(unused_variables), deny(warnings))))]
278276

279277
#![deny(rust_2018_idioms)]

src/libpanic_abort/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
66
#![no_std]
77
#![unstable(feature = "panic_abort", issue = "32837")]
8-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
9-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
10-
html_root_url = "https://doc.rust-lang.org/nightly/",
8+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
119
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
1210
#![panic_runtime]
1311

src/libpanic_unwind/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
1515
#![no_std]
1616
#![unstable(feature = "panic_unwind", issue = "32837")]
17-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
18-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
19-
html_root_url = "https://doc.rust-lang.org/nightly/",
17+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
2018
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/")]
2119

2220
#![feature(allocator_api)]

src/libproc_macro/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
1010
#![stable(feature = "proc_macro_lib", since = "1.15.0")]
1111
#![deny(missing_docs)]
12-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
13-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
14-
html_root_url = "https://doc.rust-lang.org/nightly/",
12+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/",
1513
html_playground_url = "https://play.rust-lang.org/",
1614
issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
1715
test(no_crate_inject, attr(deny(warnings))),

src/librustc/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626
//!
2727
//! This API is completely unstable and subject to change.
2828
29-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
30-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
31-
html_root_url = "https://doc.rust-lang.org/nightly/")]
29+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
3230

3331
#![deny(rust_2018_idioms)]
3432
#![allow(explicit_outlives_requirements)]

src/librustc_apfloat/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@
3030
//!
3131
//! This API is completely unstable and subject to change.
3232
33-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
34-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
35-
html_root_url = "https://doc.rust-lang.org/nightly/")]
33+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
3634
#![forbid(unsafe_code)]
3735
#![deny(rust_2018_idioms)]
3836

src/librustc_borrowck/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3-
html_root_url = "https://doc.rust-lang.org/nightly/")]
1+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
42

53
#![allow(non_camel_case_types)]
64

src/librustc_codegen_llvm/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
//!
55
//! This API is completely unstable and subject to change.
66
7-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
8-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
9-
html_root_url = "https://doc.rust-lang.org/nightly/")]
7+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
108

119
#![feature(box_patterns)]
1210
#![feature(box_syntax)]

src/librustc_codegen_ssa/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3-
html_root_url = "https://doc.rust-lang.org/nightly/")]
1+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
42

53
#![feature(box_patterns)]
64
#![feature(box_syntax)]

src/librustc_codegen_utils/codegen_backend.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
//!
55
//! This API is completely unstable and subject to change.
66
7-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
8-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
9-
html_root_url = "https://doc.rust-lang.org/nightly/")]
7+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
108
#![deny(warnings)]
119

1210
#![feature(box_syntax)]

src/librustc_codegen_utils/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
//!
33
//! This API is completely unstable and subject to change.
44
5-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
6-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
7-
html_root_url = "https://doc.rust-lang.org/nightly/")]
5+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
86

97
#![feature(box_patterns)]
108
#![feature(box_syntax)]

src/librustc_data_structures/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
//!
77
//! This API is completely unstable and subject to change.
88
9-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
10-
html_favicon_url = "https://www.rust-lang.org/favicon.ico",
11-
html_root_url = "https://doc.rust-lang.org/nightly/")]
9+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
1210

1311
#![feature(in_band_lifetimes)]
1412
#![feature(unboxed_closures)]

src/librustc_driver/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
//!
55
//! This API is completely unstable and subject to change.
66
7-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
8-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
9-
html_root_url = "https://doc.rust-lang.org/nightly/")]
7+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
108

119
#![feature(box_syntax)]
1210
#![cfg_attr(unix, feature(libc))]

src/librustc_errors/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3-
html_root_url = "https://doc.rust-lang.org/nightly/")]
1+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
42

53
#![feature(custom_attribute)]
64
#![allow(unused_attributes)]

src/librustc_incremental/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
//! Support for serializing the dep-graph and reloading it.
22
3-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
4-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
5-
html_root_url = "https://doc.rust-lang.org/nightly/")]
3+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
64

75
#![feature(nll)]
86
#![feature(specialization)]

src/librustc_lint/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,7 @@
99
//!
1010
//! This API is completely unstable and subject to change.
1111
12-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
13-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
14-
html_root_url = "https://doc.rust-lang.org/nightly/")]
12+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
1513

1614
#![cfg_attr(test, feature(test))]
1715
#![feature(box_patterns)]

src/librustc_llvm/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
#![deny(rust_2018_idioms)]
22
#![feature(static_nobundle)]
33

4-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
5-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
6-
html_root_url = "https://doc.rust-lang.org/nightly/")]
4+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
75

86
// See librustc_cratesio_shim/Cargo.toml for a comment explaining this.
97
#[allow(unused_extern_crates)]

src/librustc_metadata/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3-
html_root_url = "https://doc.rust-lang.org/nightly/")]
1+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
42

53
#![feature(box_patterns)]
64
#![feature(libc)]

src/librustc_passes/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
//!
55
//! This API is completely unstable and subject to change.
66
7-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
8-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
9-
html_root_url = "https://doc.rust-lang.org/nightly/")]
7+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
108

119
#![feature(nll)]
1210
#![feature(rustc_diagnostic_macros)]

src/librustc_plugin/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,7 @@
5050
//! See the [`plugin` feature](../unstable-book/language-features/plugin.html) of
5151
//! the Unstable Book for more examples.
5252
53-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
54-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
55-
html_root_url = "https://doc.rust-lang.org/nightly/")]
53+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
5654

5755
#![feature(rustc_diagnostic_macros)]
5856

src/librustc_privacy/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3-
html_root_url = "https://doc.rust-lang.org/nightly/")]
1+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
42

53
#![deny(rust_2018_idioms)]
64

src/librustc_resolve/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3-
html_root_url = "https://doc.rust-lang.org/nightly/")]
1+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
42

53
#![feature(crate_visibility_modifier)]
64
#![feature(label_break_value)]

src/librustc_save_analysis/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
2-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
3-
html_root_url = "https://doc.rust-lang.org/nightly/")]
1+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
42
#![feature(custom_attribute)]
53
#![feature(nll)]
64
#![allow(unused_attributes)]

src/librustc_target/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@
77
//! more 'stuff' here in the future. It does not have a dependency on
88
//! LLVM.
99
10-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
11-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
12-
html_root_url = "https://doc.rust-lang.org/nightly/")]
10+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
1311

1412
#![feature(box_syntax)]
1513
#![feature(nll)]

src/librustc_typeck/lib.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@ This API is completely unstable and subject to change.
5555
5656
*/
5757

58-
#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
59-
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
60-
html_root_url = "https://doc.rust-lang.org/nightly/")]
58+
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/")]
6159

6260
#![allow(non_camel_case_types)]
6361

src/librustdoc/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ path = "lib.rs"
99

1010
[dependencies]
1111
pulldown-cmark = { version = "0.1.2", default-features = false }
12-
minifier = "0.0.26"
12+
minifier = "0.0.28"
1313
tempfile = "3"
1414
parking_lot = "0.6.4"

src/librustdoc/html/layout.rs

+18-10
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ use std::path::PathBuf;
44

55
use externalfiles::ExternalHtml;
66

7+
use html::render::SlashChecker;
8+
79
#[derive(Clone)]
810
pub struct Layout {
911
pub logo: String,
@@ -176,16 +178,22 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
176178
static_root_path = static_root_path,
177179
root_path = page.root_path,
178180
css_class = page.css_class,
179-
logo = if layout.logo.is_empty() {
180-
format!("<a href='{}{}/index.html'>\
181-
<img src='{static_root_path}rust-logo{suffix}.png' alt='logo' width='100'></a>",
182-
static_root_path=static_root_path,
183-
suffix=page.resource_suffix)
184-
} else {
185-
format!("<a href='{}{}/index.html'>\
186-
<img src='{}' alt='logo' width='100'></a>",
187-
page.root_path, layout.krate,
188-
layout.logo)
181+
logo = {
182+
let p = format!("{}{}", page.root_path, layout.krate);
183+
let p = SlashChecker(&p);
184+
if layout.logo.is_empty() {
185+
format!("<a href='{path}index.html'>\
186+
<img src='{static_root_path}rust-logo{suffix}.png' \
187+
alt='logo' width='100'></a>",
188+
path=p,
189+
static_root_path=static_root_path,
190+
suffix=page.resource_suffix)
191+
} else {
192+
format!("<a href='{}index.html'>\
193+
<img src='{}' alt='logo' width='100'></a>",
194+
p,
195+
layout.logo)
196+
}
189197
},
190198
title = page.title,
191199
description = page.description,

0 commit comments

Comments
 (0)