chore(castore-http): upgrade to 2024 edition

Part of #114

Change-Id: I083ad939c836736b44b36c38e16a04cbaabe9442
Reviewed-on: https://cl.snix.dev/c/snix/+/30377
Autosubmit: Bence Nemes <nemes.bence1@gmail.com>
Tested-by: besadii
Reviewed-by: Florian Klink <flokli@flokli.de>
This commit is contained in:
Starnick4444 2025-05-02 22:48:24 +02:00 committed by clbot
parent b04011dd53
commit 916988a7a2
8 changed files with 16 additions and 14 deletions

View file

@ -13938,7 +13938,7 @@ rec {
"snix-castore-http" = rec { "snix-castore-http" = rec {
crateName = "snix-castore-http"; crateName = "snix-castore-http";
version = "0.1.0"; version = "0.1.0";
edition = "2021"; edition = "2024";
crateBin = [ crateBin = [
{ {
name = "snix-castore-http"; name = "snix-castore-http";

View file

@ -1,7 +1,7 @@
[package] [package]
name = "snix-castore-http" name = "snix-castore-http"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
[dependencies] [dependencies]
anyhow.workspace = true anyhow.workspace = true

View file

@ -0,0 +1,2 @@
# FUTUREWORK: move to .. once all crates are migrated (#114)
edition = "2024"

View file

@ -1,4 +1,4 @@
use snix_castore::{blobservice::BlobService, directoryservice::DirectoryService, Node}; use snix_castore::{Node, blobservice::BlobService, directoryservice::DirectoryService};
use std::sync::Arc; use std::sync::Arc;

View file

@ -1,5 +1,5 @@
use clap::Parser; use clap::Parser;
use snix_castore::{utils::ServiceUrlsGrpc, B3Digest}; use snix_castore::{B3Digest, utils::ServiceUrlsGrpc};
#[derive(Parser)] #[derive(Parser)]
#[command(author, version, about)] #[command(author, version, about)]

View file

@ -6,17 +6,17 @@ pub mod routes;
use std::path; use std::path;
use snix_castore::{ use snix_castore::{
blobservice::BlobService,
directoryservice::{descend_to, DirectoryService},
B3Digest, Directory, Node, Path, SymlinkTarget, B3Digest, Directory, Node, Path, SymlinkTarget,
blobservice::BlobService,
directoryservice::{DirectoryService, descend_to},
}; };
use axum::{ use axum::{
body::Body, body::Body,
http::{header, StatusCode}, http::{StatusCode, header},
response::{AppendHeaders, IntoResponse, Redirect, Response}, response::{AppendHeaders, IntoResponse, Redirect, Response},
}; };
use axum_extra::{headers::Range, response::Html, TypedHeader}; use axum_extra::{TypedHeader, headers::Range, response::Html};
use axum_range::{KnownSize, Ranged}; use axum_range::{KnownSize, Ranged};
use path_clean::PathClean; use path_clean::PathClean;
use std::ffi::OsStr; use std::ffi::OsStr;

View file

@ -1,10 +1,10 @@
use crate::app_state::{AppConfig, AppState}; use crate::app_state::{AppConfig, AppState};
use crate::routes; use crate::routes;
use snix_castore::utils::ServiceUrlsGrpc;
use snix_castore::Node; use snix_castore::Node;
use snix_castore::utils::ServiceUrlsGrpc;
use axum::{routing::get, Router}; use axum::{Router, routing::get};
use std::sync::Arc; use std::sync::Arc;
use tokio_listener::ListenerAddressLFlag; use tokio_listener::ListenerAddressLFlag;
use tracing::info; use tracing::info;

View file

@ -8,7 +8,7 @@ use axum::{
http::StatusCode, http::StatusCode,
response::Response, response::Response,
}; };
use axum_extra::{headers::Range, TypedHeader}; use axum_extra::{TypedHeader, headers::Range};
use std::path; use std::path;
use tracing::{debug, instrument}; use tracing::{debug, instrument};
@ -48,10 +48,10 @@ mod tests {
use crate::{app_state::AppConfig, router::app}; use crate::{app_state::AppConfig, router::app};
use snix_castore::{ use snix_castore::{
B3Digest, Directory, Node,
blobservice::{BlobService, MemoryBlobService}, blobservice::{BlobService, MemoryBlobService},
directoryservice::{DirectoryService, MemoryDirectoryService}, directoryservice::{DirectoryService, MemoryDirectoryService},
fixtures::{DIRECTORY_COMPLICATED, HELLOWORLD_BLOB_CONTENTS, HELLOWORLD_BLOB_DIGEST}, fixtures::{DIRECTORY_COMPLICATED, HELLOWORLD_BLOB_CONTENTS, HELLOWORLD_BLOB_DIGEST},
B3Digest, Directory, Node,
}; };
use axum::http::StatusCode; use axum::http::StatusCode;
@ -66,8 +66,8 @@ mod tests {
auto_index: bool, auto_index: bool,
) -> ( ) -> (
axum_test::TestServer, axum_test::TestServer,
impl BlobService, impl BlobService + use<S>,
impl DirectoryService, impl DirectoryService + use<S>,
) { ) {
let blob_service = Arc::new(MemoryBlobService::default()); let blob_service = Arc::new(MemoryBlobService::default());
let directory_service = Arc::new(MemoryDirectoryService::default()); let directory_service = Arc::new(MemoryDirectoryService::default());