Update to 2024 edition (#2001)

* Update to 2024 edition

* Update to 2024 edition; fmt, use<> and remove refs

* async functions
This commit is contained in:
James Wilson
2025-05-09 16:12:18 +01:00
committed by GitHub
parent 98c1d153b6
commit 23c62f3d5d
120 changed files with 399 additions and 322 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
use crate::rpc::RpcResponse;
use crate::shared_client::SharedClient;
use crate::{JsonRpcError, LightClientRpcError};
use futures::{stream::StreamExt, FutureExt};
use futures::{FutureExt, stream::StreamExt};
use serde_json::value::RawValue;
use smoldot_light::platform::PlatformRef;
use std::{collections::HashMap, str::FromStr};
+1 -1
View File
@@ -11,7 +11,7 @@ mod wasm_platform;
#[cfg(feature = "web")]
mod wasm_socket;
pub use helpers::{build_platform, DefaultPlatform};
pub use helpers::{DefaultPlatform, build_platform};
#[cfg(feature = "native")]
mod helpers {
+1 -1
View File
@@ -8,7 +8,7 @@
use super::wasm_socket::WasmSocket;
use core::time::Duration;
use futures_util::{future, FutureExt};
use futures_util::{FutureExt, future};
pub fn now_from_unix_epoch() -> Duration {
web_time::SystemTime::now()
+6 -2
View File
@@ -141,7 +141,9 @@ impl PlatformRef for SubxtPlatform {
// The API user of the `PlatformRef` trait is never supposed to open connections of
// a type that isn't supported.
_ => {
unreachable!("Connecting to an address not supported. This code path indicates a bug in smoldot. Please raise an issue at https://github.com/smol-dot/smoldot/issues")
unreachable!(
"Connecting to an address not supported. This code path indicates a bug in smoldot. Please raise an issue at https://github.com/smol-dot/smoldot/issues"
)
}
};
@@ -157,7 +159,9 @@ impl PlatformRef for SubxtPlatform {
}
fn connect_multistream(&self, _address: MultiStreamAddress) -> Self::MultiStreamConnectFuture {
panic!("Multistreams are not currently supported. This code path indicates a bug in smoldot. Please raise an issue at https://github.com/smol-dot/smoldot/issues")
panic!(
"Multistreams are not currently supported. This code path indicates a bug in smoldot. Please raise an issue at https://github.com/smol-dot/smoldot/issues"
)
}
fn open_out_substream(&self, c: &mut Self::MultiStream) {
+1 -1
View File
@@ -4,7 +4,7 @@
use futures::{io, prelude::*};
use send_wrapper::SendWrapper;
use wasm_bindgen::{prelude::*, JsCast};
use wasm_bindgen::{JsCast, prelude::*};
use std::{
collections::VecDeque,