Skip to content

Commit 7772d13

Browse files
committed
improve doc-comment some more
1 parent 295f5dd commit 7772d13

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/web/rustdoc.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,9 +280,15 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
280280
.to_resp("rustdoc")
281281
}
282282

283-
/// Checks whether the given path (including version and target information) exists.
283+
/// Checks whether the given path exists.
284284
/// The crate's `target_name` is used to confirm whether a platform triple is part of the path.
285285
///
286+
/// Note that path is overloaded in this context to mean both the path of a URL
287+
/// and the file path of a static file in the DB.
288+
///
289+
/// `req_path` is assumed to have the following format:
290+
/// `rustdoc/crate/version[/platform]/module/[kind.name.html|index.html]`
291+
///
286292
/// Returns a path that can be appended to `/crate/version/` to create a complete URL.
287293
fn path_for_version(req_path: &[&str], target_name: &str, conn: &Connection) -> String {
288294
// Simple case: page exists in the latest version, so just change the version number
@@ -297,7 +303,7 @@ fn path_for_version(req_path: &[&str], target_name: &str, conn: &Connection) ->
297303
} else {
298304
// this is an item
299305
req_path.last().unwrap().split('.').nth(1)
300-
.expect("paths should be of the form <class>.<name>.html")
306+
.expect("paths should be of the form <kind>.<name>.html")
301307
};
302308
// check if req_path[3] is the platform choice or the name of the crate
303309
let concat_path;

0 commit comments

Comments
 (0)