Skip to content

Commit a730b8d

Browse files
committed
wip
1 parent 279bf16 commit a730b8d

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

src/db/add_package.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::{
1010
use anyhow::{Context, anyhow};
1111
use derive_more::{Deref, Display};
1212
use futures_util::stream::TryStreamExt;
13+
use semver::VersionReq;
1314
use serde::{Deserialize, Serialize};
1415
use serde_json::Value;
1516
use slug::slugify;
@@ -34,7 +35,7 @@ pub struct ReleaseId(pub i32);
3435
pub struct BuildId(pub i32);
3536

3637
type DepOut = (String, String, String, bool);
37-
type DepIn = (String, String, Option<String>, Option<bool>);
38+
type DepIn = (String, VersionReq, Option<String>, Option<bool>);
3839

3940
/// A crate dependency in our internal representation for releases.dependencies json.
4041
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Deref)]

src/web/crate_details.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use crate::{
1818
},
1919
headers::CanonicalUrl,
2020
match_version,
21+
page::templates::{RenderBrands, RenderRegular, RenderSolid, filters},
2122
},
2223
};
2324
use anyhow::{Context, Result, anyhow};

src/web/rustdoc.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ pub(crate) async fn rustdoc_html_server_handler(
492492
// Attempt to load the given file from storage.
493493
let blob = match storage
494494
.stream_rustdoc_file(
495-
&params.name,
495+
&params.name(),
496496
&krate.version,
497497
krate.latest_build_id,
498498
&storage_path,
@@ -520,7 +520,7 @@ pub(crate) async fn rustdoc_html_server_handler(
520520

521521
if storage
522522
.rustdoc_file_exists(
523-
&params.name,
523+
&params.name(),
524524
&krate.version,
525525
krate.latest_build_id,
526526
&params.storage_path(),
@@ -560,7 +560,7 @@ pub(crate) async fn rustdoc_html_server_handler(
560560
error!(
561561
krate = params.name(),
562562
version = %krate.version,
563-
original_path = params.original_path().as_ref(),
563+
original_path = params.original_path(),
564564
storage_path,
565565
"Couldn't find crate documentation root on storage.
566566
Something is wrong with the build."
@@ -652,7 +652,7 @@ pub(crate) async fn target_redirect_handler(
652652
trace!(storage_path, "checking if path exists in other version");
653653
let redirect_uri = if storage
654654
.rustdoc_file_exists(
655-
&name,
655+
&params.name(),
656656
&crate_details.version,
657657
crate_details.latest_build_id,
658658
&storage_path,

src/web/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ pub(crate) async fn source_browser_handler(
229229
WHERE
230230
name = $1 AND
231231
version = $2"#,
232-
params.name,
232+
params.name(),
233233
version as _,
234234
)
235235
.fetch_one(&mut *conn)

templates/macros.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
{% macro dependencies_list(dependencies, use_crate_details, if_empty) %}
160160
{%- for dep in dependencies -%}
161161
<li class="pure-menu-item">
162-
{%- set dependency_params = RustdocParams::new(dep.name.to_owned()).with_req_version(ReqVersion::Semver(dep.req.parse::<semver::VersionReq>()?.clone())) -%}
162+
{%- set dependency_params = RustdocParams::new(dep.name.to_owned()).with_req_version(ReqVersion::Semver(dep.req.clone())) -%}
163163
{%- set href -%}
164164
{%- if use_crate_details -%}
165165
{%- set href = dependency_params.crate_details_url() -%}

0 commit comments

Comments
 (0)