aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhozan23 <hozan23@proton.me>2024-03-22 12:42:24 +0100
committerhozan23 <hozan23@proton.me>2024-03-22 12:42:24 +0100
commita69917ecd8272a4946cfd12c75bf8f8c075b0e50 (patch)
treee1da2c8b628cef0de24ad52034f6e62b2c9b10a6
parent5baf14594331b1b0b60d655240eb398bcce61f7c (diff)
core: cargo clippy fix & clean up comments
-rw-r--r--core/src/async_util/task_group.rs9
-rw-r--r--core/src/crypto/key_pair.rs2
2 files changed, 5 insertions, 6 deletions
diff --git a/core/src/async_util/task_group.rs b/core/src/async_util/task_group.rs
index 3de2735..7f05696 100644
--- a/core/src/async_util/task_group.rs
+++ b/core/src/async_util/task_group.rs
@@ -4,7 +4,7 @@ use async_task::FallibleTask;
use super::{executor::global_executor, select, CondWait, Either, Executor};
-/// TaskGroup is a group of spawned tasks.
+/// TaskGroup A group that contains spawned tasks.
///
/// # Example
///
@@ -36,7 +36,7 @@ pub struct TaskGroup<'a> {
impl TaskGroup<'static> {
/// Creates a new TaskGroup without providing an executor
///
- /// This will Spawn a task onto a global executor (single-threaded by default).
+ /// This will spawn a task onto a global executor (single-threaded by default).
pub fn new() -> Self {
Self {
tasks: Mutex::new(Vec::new()),
@@ -129,7 +129,7 @@ pub struct TaskHandler {
}
impl<'a> TaskHandler {
- /// Creates a new task handle
+ /// Creates a new task handler
fn new<T, Fut, CallbackF, CallbackFut>(
ex: Executor<'a>,
fut: Fut,
@@ -146,7 +146,6 @@ impl<'a> TaskHandler {
let cancel_flag_c = cancel_flag.clone();
let task = ex
.spawn(async move {
- //start_signal.signal().await;
// Waits for either the stop signal or the task to complete.
let result = select(stop_signal.wait(), fut).await;
@@ -155,7 +154,7 @@ impl<'a> TaskHandler {
Either::Right(res) => TaskResult::Completed(res),
};
- // Call the callback with the result.
+ // Call the callback
callback(result).await;
cancel_flag_c.signal().await;
diff --git a/core/src/crypto/key_pair.rs b/core/src/crypto/key_pair.rs
index efaae47..a7a8eaf 100644
--- a/core/src/crypto/key_pair.rs
+++ b/core/src/crypto/key_pair.rs
@@ -9,7 +9,7 @@ pub enum KeyPairType {
}
/// A Secret key
-pub struct SecretKey(Vec<u8>);
+pub struct SecretKey(pub Vec<u8>);
#[derive(Clone)]
pub enum KeyPair {