Skip to content

Commit

Permalink
Correct usage
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed Aug 14, 2024
1 parent 161d0f4 commit e43adad
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions api/s3/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ publish = false

[dependencies]
baza = { package = "baza-lib", path = "../../lib" }
derive_more = { version = "1", features = ["display", "error", "from"] }
hyper = "0.14"
s3-server = "0.2"
secrecy = "0.8"
Expand Down
15 changes: 5 additions & 10 deletions api/s3/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//! S3 HTTP API implementation of Baza.
// TODO: Remove on next `derive_more` major version upgrade.
#![allow(clippy::uninlined_format_args)]

use std::{
convert::Infallible,
fmt, io,
net::{TcpListener, ToSocketAddrs},
};

use derive_more::{Display, Error, From};
use hyper::{server::Server, service::make_service_fn};
use s3_server::{
dto,
Expand All @@ -19,11 +17,8 @@ use secrecy::{ExposeSecret as _, SecretString};
use tokio_util::{compat::FuturesAsyncReadCompatExt as _, io::ReaderStream};

use baza::{
async_trait,
derive_more::{Display, Error, From},
futures::future,
tracing, CreateFile, CreateSymlink, Exec, GetFile, ReadOnlyFile,
RelativePath,
async_trait, futures::future, tracing, CreateFile, CreateSymlink, Exec,
GetFile, ReadOnlyFile, RelativePath,
};

/// [`dto::PutObjectRequest::metadata`] key where [`CreateSymlink::src`] is
Expand Down Expand Up @@ -67,11 +62,11 @@ where
#[derive(Debug, Display, Error, From)]
pub enum RunHttpServerError {
/// Failed to bind address.
#[display(fmt = "Failed to bind address: {}", _0)]
#[display("Failed to bind address: {_0}")]
BindAddress(io::Error),

/// [`hyper`] server failure.
#[display(fmt = "Hyper server failed: {}", _0)]
#[display("Hyper server failed: {_0}")]
Hyper(hyper::Error),
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ publish = false
[dependencies]
async-fs = "2.1"
async-trait = "0.1"
derive_more = "1.0"
derive_more = { version = "1", features = ["display", "error"] }
futures = "0.3"
tracerr = "0.3"
tracing = "0.1"
Expand Down
3 changes: 1 addition & 2 deletions lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use tracerr::Traced;
use uuid::Uuid;

pub use async_trait::async_trait;
pub use derive_more;
pub use futures;
pub use tracing;

Expand Down Expand Up @@ -264,7 +263,7 @@ impl TryFrom<String> for RelativePath {

/// Error of parsing [`RelativePath`] from a [`String`].
#[derive(Debug, Display, Error)]
#[display(fmt = "Invalid `RelativePath` format")]
#[display("Invalid `RelativePath` format")]
pub struct InvalidRelativePathError;

#[cfg(test)]
Expand Down

0 comments on commit e43adad

Please sign in to comment.