diff --git a/nyanpasu_ipc/src/api/mod.rs b/nyanpasu_ipc/src/api/mod.rs index c245620..a2061ca 100644 --- a/nyanpasu_ipc/src/api/mod.rs +++ b/nyanpasu_ipc/src/api/mod.rs @@ -41,7 +41,7 @@ pub struct R<'a, T: Serialize + DeserializeOwned + Debug> { pub ts: i64, } -impl<'a, T: Serialize + DeserializeOwned + Debug> R<'a, T> { +impl R<'_, T> { pub fn ok(self) -> Result { if self.code == ResponseCode::Ok { Ok(self) diff --git a/nyanpasu_service/src/cmds/rpc/mod.rs b/nyanpasu_service/src/cmds/rpc/mod.rs index ed2f0f9..24e9862 100644 --- a/nyanpasu_service/src/cmds/rpc/mod.rs +++ b/nyanpasu_service/src/cmds/rpc/mod.rs @@ -84,7 +84,7 @@ pub async fn rpc(commands: RpcCommand) -> Result<(), crate::cmds::CommandError> .set_dns(&NetworkSetDnsReq { dns_servers: dns_servers .as_ref() - .map(|v| v.into_iter().map(|v| Cow::Borrowed(v)).collect()), + .map(|v| v.iter().map(Cow::Borrowed).collect()), }) .await .map_err(|e| crate::cmds::CommandError::Other(e.into()))?; diff --git a/nyanpasu_service/src/server/instance.rs b/nyanpasu_service/src/server/instance.rs index 9ff2cac..fa82460 100644 --- a/nyanpasu_service/src/server/instance.rs +++ b/nyanpasu_service/src/server/instance.rs @@ -1,6 +1,6 @@ use nyanpasu_ipc::{api::status::CoreState, utils::get_current_ts}; use nyanpasu_utils::core::{ - instance::{self, CoreInstance, CoreInstanceBuilder}, + instance::{CoreInstance, CoreInstanceBuilder}, CommandEvent, CoreType, }; use parking_lot::Mutex; diff --git a/nyanpasu_service/src/server/logger.rs b/nyanpasu_service/src/server/logger.rs index 1b096c7..bd3d129 100644 --- a/nyanpasu_service/src/server/logger.rs +++ b/nyanpasu_service/src/server/logger.rs @@ -42,7 +42,7 @@ impl<'n> Logger<'n> { } } -impl<'a> std::io::Write for Logger<'a> { +impl std::io::Write for Logger<'_> { fn write(&mut self, buf: &[u8]) -> std::io::Result { let mut buffer = self.buffer.lock(); let msg = String::from_utf8_lossy(buf);