deps: bump tokio-tungstenite 0.24 -> 0.29 (replaces #13)
Dependabot opened #13 to bump tokio-tungstenite from 0.24 to 0.29 but the bare-version bump fails to compile: WebSocketConfig became #[non_exhaustive] starting with 0.27, so the existing struct-literal construction let ws_config = WebSocketConfig { max_message_size: Some(MAX_MESSAGE_SIZE), max_frame_size: Some(MAX_FRAME_SIZE), ..WebSocketConfig::default() }; produces error[E0639]: cannot create non-exhaustive struct using struct expression Switch to the builder-style setters that 0.29 exposes on the default value. Semantics are unchanged; both fields still carry the MAX_MESSAGE_SIZE / MAX_FRAME_SIZE caps from the original config and the rest of the WebSocketConfig defaults are preserved by starting from WebSocketConfig::default(). This supersedes #13 — same target version, plus the code change Dependabot can't make on its own. Verified locally: cargo check -p wickra-data --features live-binance # clean cargo test --workspace --all-features # 630 passed / 0 failed cargo clippy --workspace --all-targets --all-features -- -D warnings
This commit is contained in:
@@ -181,11 +181,12 @@ impl BinanceKlineStream {
|
||||
streams.join("/")
|
||||
);
|
||||
let url = url::Url::parse(&url).map_err(|e| Error::Malformed(e.to_string()))?;
|
||||
let ws_config = WebSocketConfig {
|
||||
max_message_size: Some(MAX_MESSAGE_SIZE),
|
||||
max_frame_size: Some(MAX_FRAME_SIZE),
|
||||
..WebSocketConfig::default()
|
||||
};
|
||||
// tokio-tungstenite 0.29's WebSocketConfig is #[non_exhaustive],
|
||||
// so the only way to set fields is via the builder-style methods on
|
||||
// a fresh `default()` value.
|
||||
let ws_config = WebSocketConfig::default()
|
||||
.max_message_size(Some(MAX_MESSAGE_SIZE))
|
||||
.max_frame_size(Some(MAX_FRAME_SIZE));
|
||||
let (socket, _) =
|
||||
tokio_tungstenite::connect_async_with_config(url.as_str(), Some(ws_config), false)
|
||||
.await?;
|
||||
|
||||
Reference in New Issue
Block a user