X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibrustdoc%2Fhtml%2Flayout.rs;h=dc67a63d333991643b6b815f0ebc70f3c91a8703;hb=bc26def1d5d21527e70a1d161ed69bd00fb7fb4c;hp=68d70f27c8c7888acb6360295c73cc375db10cfc;hpb=2e14c1dc0cbed6358e0e5c356e48c6d709305efc;p=rust.git diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 68d70f27c8c..ec04c94dc11 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -34,6 +34,12 @@ crate static_extra_scripts: &'a [&'a str], } +impl<'a> Page<'a> { + crate fn get_static_root_path(&self) -> &str { + self.static_root_path.unwrap_or(self.root_path) + } +} + crate fn render( layout: &Layout, page: &Page<'_>, @@ -41,7 +47,7 @@ t: T, style_files: &[StylePath], ) -> String { - let static_root_path = page.static_root_path.unwrap_or(page.root_path); + let static_root_path = page.get_static_root_path(); format!( "\ \ @@ -68,7 +74,7 @@ \ \ \ -