From df435ef70db7055706bfd54fe8373550b99a7f7b Mon Sep 17 00:00:00 2001 From: cloudhead Date: Tue, 26 Mar 2024 10:05:07 +0100 Subject: [PATCH] Update radicle crates to 0.9.0 --- radicle-httpd/Cargo.toml | 13 ++++++++----- radicle-httpd/build.rs | 1 + radicle-httpd/src/api/v1/projects.rs | 4 +++- 3 files changed, 12 insertions(+), 6 deletions(-) create mode 120000 radicle-httpd/build.rs diff --git a/radicle-httpd/Cargo.toml b/radicle-httpd/Cargo.toml index ce94cdeff..05ce9b662 100644 --- a/radicle-httpd/Cargo.toml +++ b/radicle-httpd/Cargo.toml @@ -1,11 +1,13 @@ [package] name = "radicle-httpd" +description = "Radicle HTTP daemon" +homepage = "https://radicle.xyz" license = "MIT OR Apache-2.0" -version = "0.1.0" -authors = ["Alexis Sellier "] +version = "0.9.0" +authors = ["cloudhead "] edition = "2021" default-run = "radicle-httpd" -build = "../build.rs" +build = "build.rs" [features] default = [] @@ -50,18 +52,19 @@ url = { version = "2.5.0" } [dependencies.radicle] path = "../radicle" -version = "0.2.0" +version = "0" [dependencies.radicle-term] path = "../radicle-term" +version = "0" [dependencies.radicle-cli] path = "../radicle-cli" +version = "0" [dev-dependencies] hyper = { version = "1.0.1", default-features = false, features = ["client"] } pretty_assertions = { version = "1.3.0" } -radicle-cli = { path = "../radicle-cli" } radicle-crypto = { path = "../radicle-crypto", features = ["test"] } tempfile = { version = "3.3.0" } tower = { version = "0.4", features = ["util"] } diff --git a/radicle-httpd/build.rs b/radicle-httpd/build.rs new file mode 120000 index 000000000..10238032f --- /dev/null +++ b/radicle-httpd/build.rs @@ -0,0 +1 @@ +../build.rs \ No newline at end of file diff --git a/radicle-httpd/src/api/v1/projects.rs b/radicle-httpd/src/api/v1/projects.rs index 7e410a0b6..19965d06d 100644 --- a/radicle-httpd/src/api/v1/projects.rs +++ b/radicle-httpd/src/api/v1/projects.rs @@ -403,7 +403,9 @@ async fn activity_handler( ) -> impl IntoResponse { let (repo, _) = ctx.repo(project)?; let current_date = chrono::Utc::now().timestamp(); - let one_year_ago = chrono::Duration::weeks(52); + // SAFETY: The number of weeks is static and not out of bounds. + #[allow(clippy::unwrap_used)] + let one_year_ago = chrono::Duration::try_weeks(52).unwrap(); let repo = Repository::open(repo.path())?; let head = repo.head()?; let timestamps = repo