tangled
alpha
login
or
join now
nonbinary.computer
/
jacquard
80
fork
atom
A better Rust ATProto crate
80
fork
atom
overview
issues
9
pulls
pipelines
caught a couple wasm bugs in CI
Orual
4 months ago
3a8c4185
85153488
0/1
build.yml
failed
36s
+10
-13
2 changed files
expand all
collapse all
unified
split
crates
jacquard-common
src
websocket.rs
xrpc
subscription.rs
+1
-1
crates/jacquard-common/src/websocket.rs
···
364
364
/// Create a new message sink
365
365
pub fn new<S>(sink: S) -> Self
366
366
where
367
367
-
S: n0_future::Sink<WsMessage, Error = StreamError> + 'static,
367
367
+
S: n0_future::Sink<WsMessage, Error = StreamError> + Send + 'static,
368
368
{
369
369
Self(Box::new(sink))
370
370
}
+9
-12
crates/jacquard-common/src/xrpc/subscription.rs
···
179
179
180
180
static DICTIONARY: OnceLock<Vec<u8>> = OnceLock::new();
181
181
182
182
-
let dict = DICTIONARY.get_or_init(|| {
183
183
-
include_bytes!("../../zstd_dictionary").to_vec()
184
184
-
});
182
182
+
let dict = DICTIONARY.get_or_init(|| include_bytes!("../../zstd_dictionary").to_vec());
185
183
186
186
-
decode_all(std::io::Cursor::new(bytes))
187
187
-
.or_else(|_| {
188
188
-
// Try with dictionary
189
189
-
let mut decoder = zstd::Decoder::with_dictionary(std::io::Cursor::new(bytes), dict)?;
190
190
-
let mut result = Vec::new();
191
191
-
std::io::Read::read_to_end(&mut decoder, &mut result)?;
192
192
-
Ok(result)
193
193
-
})
184
184
+
decode_all(std::io::Cursor::new(bytes)).or_else(|_| {
185
185
+
// Try with dictionary
186
186
+
let mut decoder = zstd::Decoder::with_dictionary(std::io::Cursor::new(bytes), dict)?;
187
187
+
let mut result = Vec::new();
188
188
+
std::io::Read::read_to_end(&mut decoder, &mut result)?;
189
189
+
Ok(result)
190
190
+
})
194
191
}
195
192
196
193
/// Decode CBOR messages from a WebSocket stream
···
752
749
where
753
750
Sub: XrpcSubscription + Send + Sync,
754
751
{
755
755
-
let base = self.base_uri();
752
752
+
let base = self.base_uri().await;
756
753
self.subscription(base)
757
754
.with_options(opts)
758
755
.subscribe(params)