forked from Deuxfleurs/garage
[dep-upgrade-202402] cargo clippy fixes
This commit is contained in:
parent
ad5ce968d2
commit
bcbd15da84
5 changed files with 9 additions and 11 deletions
|
@ -67,8 +67,8 @@ fn open_db(path: PathBuf, engine: Engine, open: &OpenDbOpt) -> Result<Db> {
|
||||||
#[cfg(feature = "sqlite")]
|
#[cfg(feature = "sqlite")]
|
||||||
Engine::Sqlite => {
|
Engine::Sqlite => {
|
||||||
let db = sqlite_adapter::rusqlite::Connection::open(&path)?;
|
let db = sqlite_adapter::rusqlite::Connection::open(&path)?;
|
||||||
db.pragma_update(None, "journal_mode", &"WAL")?;
|
db.pragma_update(None, "journal_mode", "WAL")?;
|
||||||
db.pragma_update(None, "synchronous", &"NORMAL")?;
|
db.pragma_update(None, "synchronous", "NORMAL")?;
|
||||||
Ok(sqlite_adapter::SqliteDb::init(db))
|
Ok(sqlite_adapter::SqliteDb::init(db))
|
||||||
}
|
}
|
||||||
#[cfg(feature = "lmdb")]
|
#[cfg(feature = "lmdb")]
|
||||||
|
|
|
@ -213,10 +213,10 @@ mod tests {
|
||||||
};
|
};
|
||||||
|
|
||||||
use std::os::unix::fs::PermissionsExt;
|
use std::os::unix::fs::PermissionsExt;
|
||||||
let metadata = std::fs::metadata(&path_secret_path)?;
|
let metadata = std::fs::metadata(path_secret_path)?;
|
||||||
let mut perm = metadata.permissions();
|
let mut perm = metadata.permissions();
|
||||||
perm.set_mode(0o660);
|
perm.set_mode(0o660);
|
||||||
std::fs::set_permissions(&path_secret_path, perm)?;
|
std::fs::set_permissions(path_secret_path, perm)?;
|
||||||
|
|
||||||
// Config file that just specifies the path
|
// Config file that just specifies the path
|
||||||
let config = read_config(path_config.to_path_buf())?;
|
let config = read_config(path_config.to_path_buf())?;
|
||||||
|
|
|
@ -205,8 +205,8 @@ impl<'a> RequestBuilder<'a> {
|
||||||
all_headers.insert("x-amz-content-sha256".to_owned(), body_sha.clone());
|
all_headers.insert("x-amz-content-sha256".to_owned(), body_sha.clone());
|
||||||
|
|
||||||
let mut signed_headers = all_headers
|
let mut signed_headers = all_headers
|
||||||
.iter()
|
.keys()
|
||||||
.map(|(k, _)| k.as_ref())
|
.map(|k| k.as_ref())
|
||||||
.collect::<Vec<&str>>();
|
.collect::<Vec<&str>>();
|
||||||
signed_headers.sort();
|
signed_headers.sort();
|
||||||
let signed_headers = signed_headers.join(";");
|
let signed_headers = signed_headers.join(";");
|
||||||
|
|
|
@ -61,8 +61,7 @@ async fn test_website() {
|
||||||
.method("GET")
|
.method("GET")
|
||||||
.uri(format!(
|
.uri(format!(
|
||||||
"http://127.0.0.1:{0}/check?domain={1}",
|
"http://127.0.0.1:{0}/check?domain={1}",
|
||||||
ctx.garage.admin_port,
|
ctx.garage.admin_port, BCKT_NAME
|
||||||
BCKT_NAME.to_string()
|
|
||||||
))
|
))
|
||||||
.body(Body::new(Bytes::new()))
|
.body(Body::new(Bytes::new()))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
@ -136,8 +135,7 @@ async fn test_website() {
|
||||||
.method("GET")
|
.method("GET")
|
||||||
.uri(format!(
|
.uri(format!(
|
||||||
"http://127.0.0.1:{0}/check?domain={1}",
|
"http://127.0.0.1:{0}/check?domain={1}",
|
||||||
ctx.garage.admin_port,
|
ctx.garage.admin_port, BCKT_NAME
|
||||||
BCKT_NAME.to_string()
|
|
||||||
))
|
))
|
||||||
.body(Body::new(Bytes::new()))
|
.body(Body::new(Bytes::new()))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
|
@ -10,7 +10,7 @@ use http::header::{ACCEPT, CONTENT_TYPE};
|
||||||
use http::status::StatusCode;
|
use http::status::StatusCode;
|
||||||
use http::{HeaderName, HeaderValue, Request};
|
use http::{HeaderName, HeaderValue, Request};
|
||||||
use http_body_util::{BodyExt, Full as FullBody};
|
use http_body_util::{BodyExt, Full as FullBody};
|
||||||
use hyper::{body::Body as BodyTrait, body::Bytes};
|
use hyper::body::Bytes;
|
||||||
use hyper_rustls::HttpsConnector;
|
use hyper_rustls::HttpsConnector;
|
||||||
use hyper_util::client::legacy::{connect::HttpConnector, Client as HttpClient};
|
use hyper_util::client::legacy::{connect::HttpConnector, Client as HttpClient};
|
||||||
use hyper_util::rt::TokioExecutor;
|
use hyper_util::rt::TokioExecutor;
|
||||||
|
|
Loading…
Reference in a new issue