mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-25 23:27:56 +00:00
Remove codec::Encode and codec::Decode derives from generated APIs by default (#2008)
* Remove codec::Encode and codec::Decode from generated APIs by default * clippy fixes * clippy * More fixes, and CompactAs only if Encode/Decode * revert println in example * fix lightclient test * fix docs * Fix another rust doc comment * Fix failing storage test * Remove now-unnecessary test * clippy * clippy * Remove pointless clone
This commit is contained in:
@@ -149,8 +149,7 @@ impl PlatformRef for SubxtPlatform {
|
||||
|
||||
let socket_future = async move {
|
||||
tracing::debug!(target: LOG_TARGET, "Connecting to addr={addr}");
|
||||
WasmSocket::new(addr.as_str())
|
||||
.map_err(|err| std::io::Error::new(std::io::ErrorKind::Other, err.to_string()))
|
||||
WasmSocket::new(addr.as_str()).map_err(|err| std::io::Error::other(err.to_string()))
|
||||
};
|
||||
|
||||
future::ready(super::wasm_helpers::Stream(with_buffers::WithBuffers::new(
|
||||
|
||||
@@ -176,9 +176,7 @@ impl AsyncRead for WasmSocket {
|
||||
}
|
||||
|
||||
match inner.state {
|
||||
ConnectionState::Error => {
|
||||
Poll::Ready(Err(io::Error::new(io::ErrorKind::Other, "Socket error")))
|
||||
}
|
||||
ConnectionState::Error => Poll::Ready(Err(io::Error::other("Socket error"))),
|
||||
ConnectionState::Closed => Poll::Ready(Err(io::ErrorKind::BrokenPipe.into())),
|
||||
ConnectionState::Connecting => Poll::Pending,
|
||||
ConnectionState::Opened => {
|
||||
@@ -206,17 +204,12 @@ impl AsyncWrite for WasmSocket {
|
||||
inner.waker = Some(cx.waker().clone());
|
||||
|
||||
match inner.state {
|
||||
ConnectionState::Error => {
|
||||
Poll::Ready(Err(io::Error::new(io::ErrorKind::Other, "Socket error")))
|
||||
}
|
||||
ConnectionState::Error => Poll::Ready(Err(io::Error::other("Socket error"))),
|
||||
ConnectionState::Closed => Poll::Ready(Err(io::ErrorKind::BrokenPipe.into())),
|
||||
ConnectionState::Connecting => Poll::Pending,
|
||||
ConnectionState::Opened => match self.socket.send_with_u8_array(buf) {
|
||||
Ok(()) => Poll::Ready(Ok(buf.len())),
|
||||
Err(err) => Poll::Ready(Err(io::Error::new(
|
||||
io::ErrorKind::Other,
|
||||
format!("Write error: {err:?}"),
|
||||
))),
|
||||
Err(err) => Poll::Ready(Err(io::Error::other(format!("Write error: {err:?}")))),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user