浏览代码

fix deprecation warning for bytes

Reinier Balt 7 年之前
父节点
当前提交
870afdb4b6
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      core/src/connection/codec.rs

+ 1 - 1
core/src/connection/codec.rs

@@ -45,7 +45,7 @@ impl Encoder for APCodec {
 
         buf.reserve(3 + payload.len());
         buf.put_u8(cmd);
-        buf.put_u16::<BigEndian>(payload.len() as u16);
+        buf.put_u16_be(payload.len() as u16);
         buf.extend_from_slice(&payload);
 
         self.encode_cipher.nonce_u32(self.encode_nonce);