refactor: clean up unused binding and simplify Mutex patterns
- plugin_loader.rs: remove unused _plugin_id binding in discover_plugins - http/mod.rs: simplify config() and player_status() Mutex access patterns
This commit is contained in:
@@ -100,10 +100,12 @@ impl HttpState {
|
||||
}
|
||||
|
||||
pub(crate) fn config(&self) -> Arc<AppConfig> {
|
||||
self.config
|
||||
.lock()
|
||||
.map(|config| Arc::clone(&config))
|
||||
.expect("http config state poisoned")
|
||||
Arc::clone(
|
||||
&self
|
||||
.config
|
||||
.lock()
|
||||
.expect("http config state poisoned"),
|
||||
)
|
||||
}
|
||||
|
||||
fn replace_config(&self, config: Arc<AppConfig>) {
|
||||
@@ -122,8 +124,8 @@ impl HttpState {
|
||||
pub(crate) fn player_status(&self) -> crate::core::message::PlayerStatusData {
|
||||
self.player_status
|
||||
.lock()
|
||||
.map(|status| status.clone())
|
||||
.expect("http player status state poisoned")
|
||||
.clone()
|
||||
}
|
||||
|
||||
fn update_player_status(&self, status: crate::core::message::PlayerStatusData) {
|
||||
|
||||
Reference in New Issue
Block a user