Skip to content

Commit 68076c6

Browse files
peter-jerry-yeGuest0x0
authored andcommitted
chore: fix warnings
1 parent 6df1010 commit 68076c6

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/websocket/client.mbt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ pub async fn Client::send_close(
172172
true,
173173
OpCode::Close,
174174
payload.unsafe_reinterpret_as_bytes(),
175-
self.rand.int().to_be_bytes(),
175+
@buffer.new()..write_int_le(self.rand.int()).to_bytes(),
176176
)
177177
// Wait until the server acknowledges the close
178178
ignore(read_frame(self.conn)) catch {
@@ -193,7 +193,7 @@ pub async fn Client::send_text(self : Client, text : StringView) -> Unit {
193193
true,
194194
OpCode::Text,
195195
payload,
196-
self.rand.int().to_le_bytes(),
196+
@buffer.new()..write_int_le(self.rand.int()).to_bytes(),
197197
)
198198
}
199199
@@ -208,7 +208,7 @@ pub async fn Client::send_binary(self : Client, data : BytesView) -> Unit {
208208
true,
209209
OpCode::Binary,
210210
data,
211-
self.rand.int().to_le_bytes(),
211+
@buffer.new()..write_int_le(self.rand.int()).to_bytes(),
212212
)
213213
}
214214
@@ -226,7 +226,7 @@ async fn Client::_ping(self : Client, data? : Bytes = Bytes::new(0)) -> Unit {
226226
true,
227227
OpCode::Ping,
228228
data,
229-
self.rand.int().to_le_bytes(),
229+
@buffer.new()..write_int_le(self.rand.int()).to_bytes(),
230230
)
231231
}
232232
@@ -243,7 +243,7 @@ async fn Client::pong(self : Client, data? : Bytes = Bytes::new(0)) -> Unit {
243243
true,
244244
OpCode::Pong,
245245
data,
246-
self.rand.int().to_be_bytes(),
246+
@buffer.new()..write_int_le(self.rand.int()).to_bytes(),
247247
)
248248
}
249249

src/websocket/server.mbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ async fn ServerConnection::handshake(conn : @socket.Tcp) -> ServerConnection {
9898
{
9999
conn,
100100
closed: None,
101-
out: @aqueue.new(),
101+
out: @aqueue.new(kind=Unbounded),
102102
semaphore: @semaphore.Semaphore::new(1),
103103
}
104104
}
@@ -107,7 +107,7 @@ async fn ServerConnection::handshake(conn : @socket.Tcp) -> ServerConnection {
107107
/// The main read loop for the WebSocket connection
108108
///
109109
/// This does not raise any errors. Errors are communicated via the out queue.
110-
async fn ServerConnection::serve_read(self : ServerConnection) -> Unit noraise {
110+
async fn ServerConnection::serve_read(self : ServerConnection) -> Unit {
111111
let frames : Array[Frame] = []
112112
let mut first_opcode : OpCode? = None
113113
while self.closed is None {

0 commit comments

Comments
 (0)