No more cast_mut()
This commit is contained in:
@@ -56,7 +56,7 @@ pub trait Device: DeviceFulfillment {
|
||||
device
|
||||
}
|
||||
|
||||
async fn execute(&mut self, command: Command) -> Result<(), ErrorCode> {
|
||||
async fn execute(&self, command: Command) -> Result<(), ErrorCode> {
|
||||
DeviceFulfillment::execute(self, command.clone())
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
@@ -138,7 +138,7 @@ impl GoogleHome {
|
||||
let execution = command.execution.clone();
|
||||
async move {
|
||||
if let Some(device) = devices.get(id.as_str())
|
||||
&& let Some(device) = device.write().await.as_mut().cast_mut()
|
||||
&& let Some(device) = device.write().await.as_ref().cast()
|
||||
{
|
||||
if !device.is_online() {
|
||||
return (id, Ok(false));
|
||||
|
||||
Reference in New Issue
Block a user