From a69917ecd8272a4946cfd12c75bf8f8c075b0e50 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Fri, 22 Mar 2024 12:42:24 +0100 Subject: core: cargo clippy fix & clean up comments --- core/src/async_util/task_group.rs | 9 ++++----- core/src/crypto/key_pair.rs | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'core/src') 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( 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); +pub struct SecretKey(pub Vec); #[derive(Clone)] pub enum KeyPair { -- cgit v1.2.3