Skip to content

Commit 14e9451

Browse files
committed
Encode
1 parent 9150aa2 commit 14e9451

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

gel-protocol/src/server_message.rs

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub struct RawPacket {
203203
pub data: Bytes,
204204
}
205205

206-
fn encode<T: Encode>(buf: &mut Output, _code: u8, msg: &T) -> Result<(), EncodeError> {
206+
fn encode<T: Encode>(buf: &mut Output, msg: &T) -> Result<(), EncodeError> {
207207
msg.encode(buf)?;
208208
Ok(())
209209
}
@@ -276,23 +276,23 @@ impl ServerMessage {
276276
pub fn encode(&self, buf: &mut Output) -> Result<(), EncodeError> {
277277
use ServerMessage::*;
278278
match self {
279-
ServerHandshake(h) => encode(buf, 0x76, h),
280-
ErrorResponse(h) => encode(buf, 0x45, h),
281-
LogMessage(h) => encode(buf, 0x4c, h),
282-
Authentication(h) => encode(buf, 0x52, h),
283-
ReadyForCommand(h) => encode(buf, 0x5a, h),
284-
ServerKeyData(h) => encode(buf, 0x4b, h),
285-
ParameterStatus(h) => encode(buf, 0x53, h),
286-
CommandComplete0(h) => encode(buf, 0x43, h),
287-
CommandComplete1(h) => encode(buf, 0x43, h),
288-
PrepareComplete(h) => encode(buf, 0x31, h),
289-
CommandDataDescription0(h) => encode(buf, 0x54, h),
290-
CommandDataDescription1(h) => encode(buf, 0x54, h),
291-
StateDataDescription(h) => encode(buf, 0x73, h),
292-
Data(h) => encode(buf, 0x44, h),
293-
RestoreReady(h) => encode(buf, 0x2b, h),
294-
DumpHeader(h) => encode(buf, 0x40, h),
295-
DumpBlock(h) => encode(buf, 0x3d, h),
279+
ServerHandshake(h) => encode(buf, h),
280+
ErrorResponse(h) => encode(buf, h),
281+
LogMessage(h) => encode(buf, h),
282+
Authentication(h) => encode(buf, h),
283+
ReadyForCommand(h) => encode(buf, h),
284+
ServerKeyData(h) => encode(buf, h),
285+
ParameterStatus(h) => encode(buf, h),
286+
CommandComplete0(h) => encode(buf, h),
287+
CommandComplete1(h) => encode(buf, h),
288+
PrepareComplete(h) => encode(buf, h),
289+
CommandDataDescription0(h) => encode(buf, h),
290+
CommandDataDescription1(h) => encode(buf, h),
291+
StateDataDescription(h) => encode(buf, h),
292+
Data(h) => encode(buf, h),
293+
RestoreReady(h) => encode(buf, h),
294+
DumpHeader(h) => encode(buf, h),
295+
DumpBlock(h) => encode(buf, h),
296296

297297
UnknownMessage(_, _) => errors::UnknownMessageCantBeEncoded.fail()?,
298298
}

0 commit comments

Comments
 (0)