A fork of attic a self-hostable Nix Binary Cache server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cargo fmt

authored by

Cole Helbling and committed by
Zhaofeng Li
26234c29 51d5121a

+13 -10
+2 -4
attic/build.rs
··· 11 11 fn build_bridge() { 12 12 // Temporary workaround for issue in <https://github.com/NixOS/nix/pull/8484> 13 13 let hacky_include = { 14 - let dir = tempfile::tempdir() 15 - .expect("Failed to create temporary directory for workaround"); 16 - std::fs::write(dir.path().join("uds-remote-store.md"), "\"\"") 17 - .unwrap(); 14 + let dir = tempfile::tempdir().expect("Failed to create temporary directory for workaround"); 15 + std::fs::write(dir.path().join("uds-remote-store.md"), "\"\"").unwrap(); 18 16 dir 19 17 }; 20 18
+3 -2
attic/src/nix_store/nix_store.rs
··· 9 9 10 10 use super::bindings::{open_nix_store, AsyncWriteAdapter, FfiNixStore}; 11 11 use super::{to_base_name, StorePath, ValidPathInfo}; 12 - use crate::hash::Hash; 13 12 use crate::error::AtticResult; 13 + use crate::hash::Hash; 14 14 15 15 /// High-level wrapper for the Unix Domain Socket Nix Store. 16 16 pub struct NixStore { ··· 201 201 202 202 // FIXME: Make this more ergonomic and efficient 203 203 let nar_size = c_path_info.pin_mut().nar_size(); 204 - let nar_sha256_hash: [u8; 32] = c_path_info.pin_mut().nar_sha256_hash().try_into().unwrap(); 204 + let nar_sha256_hash: [u8; 32] = 205 + c_path_info.pin_mut().nar_sha256_hash().try_into().unwrap(); 205 206 let references = c_path_info 206 207 .pin_mut() 207 208 .references()
+8 -4
server/src/storage/s3.rs
··· 5 5 6 6 use async_trait::async_trait; 7 7 use aws_sdk_s3::{ 8 - operation::get_object::builders::GetObjectFluentBuilder, 9 8 config::Builder as S3ConfigBuilder, 10 - types::{CompletedMultipartUpload, CompletedPart}, 11 - presigning::PresigningConfig, 12 9 config::{Credentials, Region}, 10 + operation::get_object::builders::GetObjectFluentBuilder, 11 + presigning::PresigningConfig, 12 + types::{CompletedMultipartUpload, CompletedPart}, 13 13 Client, 14 14 }; 15 15 use bytes::BytesMut; ··· 141 141 Ok((client, file)) 142 142 } 143 143 144 - async fn get_download(&self, req: GetObjectFluentBuilder, prefer_stream: bool) -> ServerResult<Download> { 144 + async fn get_download( 145 + &self, 146 + req: GetObjectFluentBuilder, 147 + prefer_stream: bool, 148 + ) -> ServerResult<Download> { 145 149 if prefer_stream { 146 150 let output = req.send().await.map_err(ServerError::storage_error)?; 147 151