Description
Currently, coffee_plugin crate is producing two similar clippy warnings. The warning message is as follows:
warning: this `MutexGuard` is held across an `await` point
--> coffee_plugin/src/plugin/state.rs:45:9
|
45 | / self.coffee()
46 | | .lock()
47 | | .unwrap()
| |_____________________^
|
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
note: these are all the `await` points this lock is held through
--> coffee_plugin/src/plugin/state.rs:45:9
|
45 | / self.coffee()
46 | | .lock()
47 | | .unwrap()
48 | | .setup(&self.args.clone().unwrap().conf)
49 | | .await?;
| |____________________^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#await_holding_lock
Goal
The aim of this issue is to resolve the clippy warnings in the coffee_plugin crate. Specifically, we need to address the warning about MutexGuard being held across an await point.
Proposed Solution
To fix these warnings, we will need to make the code clippy compliant by either using an async-aware Mutex type (tokio) or ensuring that the MutexGuard is dropped before invoking the await function.
If you encounter any issues or have any questions related to this task, please don't hesitate to open a discussion about it or leave a comment on the issue.
Description
Currently,
coffee_plugincrate is producing two similar clippy warnings. The warning message is as follows:Goal
The aim of this issue is to resolve the clippy warnings in the
coffee_plugincrate. Specifically, we need to address the warning aboutMutexGuardbeing held across anawaitpoint.Proposed Solution
To fix these warnings, we will need to make the code clippy compliant by either using an async-aware
Mutextype (tokio) or ensuring that theMutexGuardis dropped before invoking theawaitfunction.