message: use early return to make function easier to read
diff: @@ -285,10 +285,11 @@ pub fn rustdoc_html_server_handler(req: &mut Request) -> IronResult<Response> {
  ///
  /// Returns a path that can be appended to `/crate/version/` to create a complete URL.
  fn path_for_version(req_path: &[&str], target_name: &str, conn: &Connection) -> String {
  + // Simple case: page exists in the latest version, so just change the version number
  if File::from_path(&conn, &req_path.join("/")).is_some() {
  // NOTE: this adds 'index.html' if it wasn't there before
  - req_path[3..].join("/")
  - } else {
  + return req_path[3..].join("/");
  + }
  // this page doesn't exist in the latest version
  let search_item = if *req_path.last().unwrap() == "index.html" {
  // this is a module
  @@ -308,7 +309,6 @@ fn path_for_version(req_path: &[&str], target_name: &str, conn: &Connection) ->
  };
  format!("{}/?search={}", crate_root, search_item)
  }
  -}
  pub fn badge_handler(req: &mut Request) -> IronResult<Response> {
  use iron::headers::ContentType;
  