summaryrefslogtreecommitdiffstats
path: root/crates/common
diff options
context:
space:
mode:
Diffstat (limited to 'crates/common')
-rw-r--r--crates/common/certificate/src/lib.rs2
-rw-r--r--crates/common/download/examples/simple_download.rs4
-rw-r--r--crates/common/download/src/download.rs2
-rw-r--r--crates/common/flockfile/src/unix.rs2
-rw-r--r--crates/common/json_writer/src/lib.rs6
-rw-r--r--crates/common/mqtt_channel/src/tests.rs4
-rw-r--r--crates/common/tedge_config/src/tedge_config_repository.rs4
-rw-r--r--crates/common/tedge_utils/src/file.rs14
-rw-r--r--crates/common/tedge_utils/src/fs.rs6
-rw-r--r--crates/common/tedge_utils/src/fs_notify.rs8
10 files changed, 26 insertions, 26 deletions
diff --git a/crates/common/certificate/src/lib.rs b/crates/common/certificate/src/lib.rs
index 0c81a73d..ecfbd88a 100644
--- a/crates/common/certificate/src/lib.rs
+++ b/crates/common/certificate/src/lib.rs
@@ -110,7 +110,7 @@ impl KeyCertPair {
id: &str,
not_before: OffsetDateTime,
) -> Result<KeyCertPair, CertificateError> {
- let () = KeyCertPair::check_identifier(id, config.max_cn_size)?;
+ KeyCertPair::check_identifier(id, config.max_cn_size)?;
let mut distinguished_name = rcgen::DistinguishedName::new();
distinguished_name.push(rcgen::DnType::CommonName, id);
distinguished_name.push(rcgen::DnType::OrganizationName, &config.organization_name);
diff --git a/crates/common/download/examples/simple_download.rs b/crates/common/download/examples/simple_download.rs
index e583b0eb..763a91c0 100644
--- a/crates/common/download/examples/simple_download.rs
+++ b/crates/common/download/examples/simple_download.rs
@@ -14,10 +14,10 @@ async fn main() -> Result<()> {
let downloader = Downloader::new("test_download", &None, "/tmp");
// Call `download` method to get data from url.
- let () = downloader.download(&url_data).await?;
+ downloader.download(&url_data).await?;
// Call cleanup method to remove downloaded file if no longer necessary.
- let () = downloader.cleanup().await?;
+ downloader.cleanup().await?;
Ok(())
}
diff --git a/crates/common/download/src/download.rs b/crates/common/download/src/download.rs
index cc96f689..692cb1a7 100644
--- a/crates/common/download/src/download.rs
+++ b/crates/common/download/src/download.rs
@@ -219,7 +219,7 @@ mod tests {
let url = DownloadInfo::new(&target_url);
let downloader = Downloader::new(&name, &version, target_dir_path.path());
- let () = downloader.download(&url).await?;
+ downloader.download(&url).await?;
let log_content = std::fs::read(downloader.filename())?;
diff --git a/crates/common/flockfile/src/unix.rs b/crates/common/flockfile/src/unix.rs
index 4ef847d2..5980397f 100644
--- a/crates/common/flockfile/src/unix.rs
+++ b/crates/common/flockfile/src/unix.rs
@@ -56,7 +56,7 @@ impl Flockfile {
}
};
- let () = match flock(file.as_raw_fd(), FlockArg::LockExclusiveNonblock) {
+ match flock(file.as_raw_fd(), FlockArg::LockExclusiveNonblock) {
Ok(()) => (),
Err(err) => {
return Err(FlockfileError::FromNix { path, source: err });
diff --git a/crates/common/json_writer/src/lib.rs b/crates/common/json_writer/src/lib.rs
index df92765b..c5a3c23f 100644
--- a/crates/common/json_writer/src/lib.rs
+++ b/crates/common/json_writer/src/lib.rs
@@ -41,7 +41,7 @@ impl JsonWriter {
pub fn write_key(&mut self, key: &str) -> Result<(), JsonWriterError> {
self.maybe_separate();
- let () = serde_json::to_writer(&mut self.buffer, key)?;
+ serde_json::to_writer(&mut self.buffer, key)?;
self.buffer.push(b':');
self.needs_separator = false;
Ok(())
@@ -49,7 +49,7 @@ impl JsonWriter {
pub fn write_str(&mut self, s: &str) -> Result<(), JsonWriterError> {
self.maybe_separate();
- let () = serde_json::to_writer(&mut self.buffer, s)?;
+ serde_json::to_writer(&mut self.buffer, s)?;
self.needs_separator = true;
Ok(())
}
@@ -58,7 +58,7 @@ impl JsonWriter {
self.maybe_separate();
match value.classify() {
FpCategory::Normal | FpCategory::Zero | FpCategory::Subnormal => {
- let () = serde_json::to_writer(&mut self.buffer, &value)?;
+ serde_json::to_writer(&mut self.buffer, &value)?;
self.needs_separator = true;
Ok(())
}
diff --git a/crates/common/mqtt_channel/src/tests.rs b/crates/common/mqtt_channel/src/tests.rs
index fb30eac7..7a8201e5 100644
--- a/crates/common/mqtt_channel/src/tests.rs
+++ b/crates/common/mqtt_channel/src/tests.rs
@@ -99,7 +99,7 @@ mod tests {
]
.into_iter()
{
- let () = broker.publish(topic, payload).await?;
+ broker.publish(topic, payload).await?;
assert_eq!(
MaybeMessage::Next(message(topic, payload)),
next_message(&mut messages).await
@@ -113,7 +113,7 @@ mod tests {
]
.into_iter()
{
- let () = broker.publish(topic, payload).await?;
+ broker.publish(topic, payload).await?;
assert_eq!(MaybeMessage::Timeout, next_message(&mut messages).await);
}
diff --git a/crates/common/tedge_config/src/tedge_config_repository.rs b/crates/common/tedge_config/src/tedge_config_repository.rs
index 5c818c7b..894116d8 100644
--- a/crates/common/tedge_config/src/tedge_config_repository.rs
+++ b/crates/common/tedge_config/src/tedge_config_repository.rs
@@ -32,10 +32,10 @@ impl ConfigRepository<TEdgeConfig> for TEdgeConfigRepository {
// Create `$HOME/.tedge` or `/etc/tedge` directory in case it does not exist yet
if !self.config_location.tedge_config_root_path.exists() {
- let () = fs::create_dir(self.config_location.tedge_config_root_path())?;
+ fs::create_dir(self.config_location.tedge_config_root_path())?;
}
- let () = atomically_write_file_sync(
+ atomically_write_file_sync(
self.config_location.temporary_tedge_config_file_path(),
self.config_location.tedge_config_file_path(),
toml.as_bytes(),
diff --git a/crates/common/tedge_utils/src/file.rs b/crates/common/tedge_utils/src/file.rs
index 4da9f1bf..f3659d56 100644
--- a/crates/common/tedge_utils/src/file.rs
+++ b/crates/common/tedge_utils/src/file.rs
@@ -74,19 +74,19 @@ impl PermissionEntry {
pub fn apply(&self, path: &Path) -> Result<(), FileError> {
match (&self.user, &self.group) {
(Some(user), Some(group)) => {
- let () = change_user_and_group(path, user, group)?;
+ change_user_and_group(path, user, group)?;
}
(Some(user), None) => {
- let () = change_user(path, user)?;
+ change_user(path, user)?;
}
(None, Some(group)) => {
- let () = change_group(path, group)?;
+ change_group(path, group)?;
}
(None, None) => {}
}
if let Some(mode) = &self.mode {
- let () = change_mode(path, *mode)?;
+ change_mode(path, *mode)?;
}
Ok(())
@@ -95,7 +95,7 @@ impl PermissionEntry {
fn create_directory(&self, dir: &Path) -> Result<(), FileError> {
match fs::create_dir(dir) {
Ok(_) => {
- let () = self.apply(dir)?;
+ self.apply(dir)?;
Ok(())
}
Err(e) if e.kind() == io::ErrorKind::AlreadyExists => Ok(()),
@@ -119,7 +119,7 @@ impl PermissionEntry {
.open(file)
{
Ok(mut f) => {
- let () = self.apply(file)?;
+ self.apply(file)?;
if let Some(default_content) = default_content {
f.write(default_content.as_bytes()).map_err(|e| {
FileError::WriteContentFailed {
@@ -342,7 +342,7 @@ mod tests {
assert!(format!("{:o}", perm.mode()).contains("644"));
let permission_set = PermissionEntry::new(None, None, Some(0o444));
- let () = permission_set.apply(Path::new(file_path.as_str())).unwrap();
+ permission_set.apply(Path::new(file_path.as_str())).unwrap();
let meta = fs::metadata(file_path.as_str()).unwrap();
let perm = meta.permissions();
diff --git a/crates/common/tedge_utils/src/fs.rs b/crates/common/tedge_utils/src/fs.rs
index fff39647..6f679891 100644
--- a/crates/common/tedge_utils/src/fs.rs
+++ b/crates/common/tedge_utils/src/fs.rs
@@ -41,14 +41,14 @@ pub async fn atomically_write_file_async(
.await?;
if let Err(err) = file.write_all(content).await {
- let () = tokio_fs::remove_file(tempfile).await?;
+ tokio_fs::remove_file(tempfile).await?;
return Err(err);
}
file.flush().await?;
if let Err(err) = tokio_fs::rename(tempfile.as_ref(), dest).await {
- let () = tokio_fs::remove_file(tempfile).await?;
+ tokio_fs::remove_file(tempfile).await?;
return Err(err);
}
@@ -69,7 +69,7 @@ mod tests {
let content = "test_data";
- let () = atomically_write_file_async(&temp_path, &destination_path, content.as_bytes())
+ atomically_write_file_async(&temp_path, &destination_path, content.as_bytes())
.await
.unwrap();
diff --git a/crates/common/tedge_utils/src/fs_notify.rs b/crates/common/tedge_utils/src/fs_notify.rs
index 414fca57..6745c180 100644
--- a/crates/common/tedge_utils/src/fs_notify.rs
+++ b/crates/common/tedge_utils/src/fs_notify.rs
@@ -536,8 +536,8 @@ mod tests {
ttd_clone.file("file_b").with_raw_content("content");
});
- let () = fs_notify_handler.await.unwrap();
- let () = file_handler.await.unwrap();
+ fs_notify_handler.await.unwrap();
+ file_handler.await.unwrap();
}
#[tokio::test]
@@ -568,7 +568,7 @@ mod tests {
ttd_clone.file("file_c").delete(); // should match CREATE, DELETE
});
- let () = fs_notify_handler.await.unwrap();
- let () = file_handler.await.unwrap();
+ fs_notify_handler.await.unwrap();
+ file_handler.await.unwrap();
}
}