mirror of
https://github.com/zhaofengli/attic.git
synced 2024-12-14 11:57:30 +00:00
cargo fmt
This commit is contained in:
parent
51d5121a5c
commit
26234c294a
3 changed files with 13 additions and 10 deletions
|
@ -11,10 +11,8 @@ fn main() {
|
||||||
fn build_bridge() {
|
fn build_bridge() {
|
||||||
// Temporary workaround for issue in <https://github.com/NixOS/nix/pull/8484>
|
// Temporary workaround for issue in <https://github.com/NixOS/nix/pull/8484>
|
||||||
let hacky_include = {
|
let hacky_include = {
|
||||||
let dir = tempfile::tempdir()
|
let dir = tempfile::tempdir().expect("Failed to create temporary directory for workaround");
|
||||||
.expect("Failed to create temporary directory for workaround");
|
std::fs::write(dir.path().join("uds-remote-store.md"), "\"\"").unwrap();
|
||||||
std::fs::write(dir.path().join("uds-remote-store.md"), "\"\"")
|
|
||||||
.unwrap();
|
|
||||||
dir
|
dir
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -9,8 +9,8 @@ use tokio::task::spawn_blocking;
|
||||||
|
|
||||||
use super::bindings::{open_nix_store, AsyncWriteAdapter, FfiNixStore};
|
use super::bindings::{open_nix_store, AsyncWriteAdapter, FfiNixStore};
|
||||||
use super::{to_base_name, StorePath, ValidPathInfo};
|
use super::{to_base_name, StorePath, ValidPathInfo};
|
||||||
use crate::hash::Hash;
|
|
||||||
use crate::error::AtticResult;
|
use crate::error::AtticResult;
|
||||||
|
use crate::hash::Hash;
|
||||||
|
|
||||||
/// High-level wrapper for the Unix Domain Socket Nix Store.
|
/// High-level wrapper for the Unix Domain Socket Nix Store.
|
||||||
pub struct NixStore {
|
pub struct NixStore {
|
||||||
|
@ -201,7 +201,8 @@ impl NixStore {
|
||||||
|
|
||||||
// FIXME: Make this more ergonomic and efficient
|
// FIXME: Make this more ergonomic and efficient
|
||||||
let nar_size = c_path_info.pin_mut().nar_size();
|
let nar_size = c_path_info.pin_mut().nar_size();
|
||||||
let nar_sha256_hash: [u8; 32] = c_path_info.pin_mut().nar_sha256_hash().try_into().unwrap();
|
let nar_sha256_hash: [u8; 32] =
|
||||||
|
c_path_info.pin_mut().nar_sha256_hash().try_into().unwrap();
|
||||||
let references = c_path_info
|
let references = c_path_info
|
||||||
.pin_mut()
|
.pin_mut()
|
||||||
.references()
|
.references()
|
||||||
|
|
|
@ -5,11 +5,11 @@ use std::time::Duration;
|
||||||
|
|
||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
use aws_sdk_s3::{
|
use aws_sdk_s3::{
|
||||||
operation::get_object::builders::GetObjectFluentBuilder,
|
|
||||||
config::Builder as S3ConfigBuilder,
|
config::Builder as S3ConfigBuilder,
|
||||||
types::{CompletedMultipartUpload, CompletedPart},
|
|
||||||
presigning::PresigningConfig,
|
|
||||||
config::{Credentials, Region},
|
config::{Credentials, Region},
|
||||||
|
operation::get_object::builders::GetObjectFluentBuilder,
|
||||||
|
presigning::PresigningConfig,
|
||||||
|
types::{CompletedMultipartUpload, CompletedPart},
|
||||||
Client,
|
Client,
|
||||||
};
|
};
|
||||||
use bytes::BytesMut;
|
use bytes::BytesMut;
|
||||||
|
@ -141,7 +141,11 @@ impl S3Backend {
|
||||||
Ok((client, file))
|
Ok((client, file))
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn get_download(&self, req: GetObjectFluentBuilder, prefer_stream: bool) -> ServerResult<Download> {
|
async fn get_download(
|
||||||
|
&self,
|
||||||
|
req: GetObjectFluentBuilder,
|
||||||
|
prefer_stream: bool,
|
||||||
|
) -> ServerResult<Download> {
|
||||||
if prefer_stream {
|
if prefer_stream {
|
||||||
let output = req.send().await.map_err(ServerError::storage_error)?;
|
let output = req.send().await.map_err(ServerError::storage_error)?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue