aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/cli/convert_db.rs4
-rw-r--r--src/garage/secrets.rs4
-rw-r--r--src/garage/server.rs13
-rw-r--r--src/garage/tests/common/custom_requester.rs4
-rw-r--r--src/garage/tests/s3/website.rs6
5 files changed, 12 insertions, 19 deletions
diff --git a/src/garage/cli/convert_db.rs b/src/garage/cli/convert_db.rs
index 044ccbb9..6b854ccb 100644
--- a/src/garage/cli/convert_db.rs
+++ b/src/garage/cli/convert_db.rs
@@ -67,8 +67,8 @@ fn open_db(path: PathBuf, engine: Engine, open: &OpenDbOpt) -> Result<Db> {
#[cfg(feature = "sqlite")]
Engine::Sqlite => {
let db = sqlite_adapter::rusqlite::Connection::open(&path)?;
- db.pragma_update(None, "journal_mode", &"WAL")?;
- db.pragma_update(None, "synchronous", &"NORMAL")?;
+ db.pragma_update(None, "journal_mode", "WAL")?;
+ db.pragma_update(None, "synchronous", "NORMAL")?;
Ok(sqlite_adapter::SqliteDb::init(db))
}
#[cfg(feature = "lmdb")]
diff --git a/src/garage/secrets.rs b/src/garage/secrets.rs
index e96be9e4..8c89a262 100644
--- a/src/garage/secrets.rs
+++ b/src/garage/secrets.rs
@@ -213,10 +213,10 @@ mod tests {
};
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();
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
let config = read_config(path_config.to_path_buf())?;
diff --git a/src/garage/server.rs b/src/garage/server.rs
index de8ac9e2..51b06b8e 100644
--- a/src/garage/server.rs
+++ b/src/garage/server.rs
@@ -88,7 +88,7 @@ pub async fn run_server(config_file: PathBuf, secrets: Secrets) -> Result<(), Er
garage.clone(),
s3_bind_addr.clone(),
config.s3_api.s3_region.clone(),
- wait_from(watch_cancel.clone()),
+ watch_cancel.clone(),
)),
));
}
@@ -103,7 +103,7 @@ pub async fn run_server(config_file: PathBuf, secrets: Secrets) -> Result<(), Er
garage.clone(),
config.k2v_api.as_ref().unwrap().api_bind_addr.clone(),
config.s3_api.s3_region.clone(),
- wait_from(watch_cancel.clone()),
+ watch_cancel.clone(),
)),
));
}
@@ -116,10 +116,7 @@ pub async fn run_server(config_file: PathBuf, secrets: Secrets) -> Result<(), Er
let web_server = WebServer::new(garage.clone(), web_config.root_domain.clone());
servers.push((
"Web",
- tokio::spawn(web_server.run(
- web_config.bind_addr.clone(),
- wait_from(watch_cancel.clone()),
- )),
+ tokio::spawn(web_server.run(web_config.bind_addr.clone(), watch_cancel.clone())),
));
}
@@ -127,9 +124,7 @@ pub async fn run_server(config_file: PathBuf, secrets: Secrets) -> Result<(), Er
info!("Launching Admin API server...");
servers.push((
"Admin",
- tokio::spawn(
- admin_server.run(admin_bind_addr.clone(), wait_from(watch_cancel.clone())),
- ),
+ tokio::spawn(admin_server.run(admin_bind_addr.clone(), watch_cancel.clone())),
));
}
diff --git a/src/garage/tests/common/custom_requester.rs b/src/garage/tests/common/custom_requester.rs
index 72fb1a46..e5f4cca1 100644
--- a/src/garage/tests/common/custom_requester.rs
+++ b/src/garage/tests/common/custom_requester.rs
@@ -205,8 +205,8 @@ impl<'a> RequestBuilder<'a> {
all_headers.insert("x-amz-content-sha256".to_owned(), body_sha.clone());
let mut signed_headers = all_headers
- .iter()
- .map(|(k, _)| k.as_ref())
+ .keys()
+ .map(|k| k.as_ref())
.collect::<Vec<&str>>();
signed_headers.sort();
let signed_headers = signed_headers.join(";");
diff --git a/src/garage/tests/s3/website.rs b/src/garage/tests/s3/website.rs
index 19f53fcd..0cadc388 100644
--- a/src/garage/tests/s3/website.rs
+++ b/src/garage/tests/s3/website.rs
@@ -61,8 +61,7 @@ async fn test_website() {
.method("GET")
.uri(format!(
"http://127.0.0.1:{0}/check?domain={1}",
- ctx.garage.admin_port,
- BCKT_NAME.to_string()
+ ctx.garage.admin_port, BCKT_NAME
))
.body(Body::new(Bytes::new()))
.unwrap()
@@ -136,8 +135,7 @@ async fn test_website() {
.method("GET")
.uri(format!(
"http://127.0.0.1:{0}/check?domain={1}",
- ctx.garage.admin_port,
- BCKT_NAME.to_string()
+ ctx.garage.admin_port, BCKT_NAME
))
.body(Body::new(Bytes::new()))
.unwrap()