Skip to content

Commit f78472b

Browse files
committed
Improve comment
1 parent ec5ca48 commit f78472b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/utils/html.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use tera::Context;
77
/// Given a rustdoc HTML page and a context to serialize it with,
88
/// render the `rustdoc/` templates with the `html`.
99
/// The output is an HTML page which has not yet been UTF-8 validated.
10+
/// In practice, the output should always be valid UTF-8.
1011
pub(crate) fn rewrite_lol(
1112
html: &[u8],
1213
max_allowed_memory_usage: usize,

src/web/rustdoc.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,12 @@ struct RustdocPage {
192192
}
193193

194194
impl RustdocPage {
195-
fn into_response(self, rustdoc_html: &[u8], max_parse_memory: usize, req: &mut Request) -> IronResult<Response> {
195+
fn into_response(
196+
self,
197+
rustdoc_html: &[u8],
198+
max_parse_memory: usize,
199+
req: &mut Request,
200+
) -> IronResult<Response> {
196201
use iron::{headers::ContentType, status::Status};
197202

198203
let templates = req
@@ -203,7 +208,10 @@ impl RustdocPage {
203208
// Build the page of documentation
204209
let ctx = ctry!(req, tera::Context::from_serialize(self),);
205210
// Extract the head and body of the rustdoc file so that we can insert it into our own html
206-
let html = ctry!(req, utils::rewrite_lol(rustdoc_html, max_parse_memory, ctx, templates));
211+
let html = ctry!(
212+
req,
213+
utils::rewrite_lol(rustdoc_html, max_parse_memory, ctx, templates)
214+
);
207215

208216
let mut response = Response::with((Status::Ok, html));
209217
response.headers.set(ContentType::html());

0 commit comments

Comments
 (0)