summaryrefslogtreecommitdiff
path: root/core/ops_bin.rs
diff options
context:
space:
mode:
authorYusuke Tanaka <yusuktan@maguro.dev>2021-03-26 03:17:37 +0900
committerGitHub <noreply@github.com>2021-03-25 19:17:37 +0100
commite7954413e16d5814db5da6389f8d6e0c328812aa (patch)
tree2840a275019df3e193c7c2f84442740ce7b7e48e /core/ops_bin.rs
parent881e1e8164f1661158bac24f7ec03b969a0a8a02 (diff)
upgrade: Rust 1.51.0 (#9895)
Diffstat (limited to 'core/ops_bin.rs')
-rw-r--r--core/ops_bin.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/ops_bin.rs b/core/ops_bin.rs
index 053150bfd..3e13c23d5 100644
--- a/core/ops_bin.rs
+++ b/core/ops_bin.rs
@@ -39,12 +39,12 @@ pub struct ResponseHeader {
pub result: u32,
}
-impl Into<[u8; 16]> for ResponseHeader {
- fn into(self) -> [u8; 16] {
+impl From<ResponseHeader> for [u8; 16] {
+ fn from(r: ResponseHeader) -> Self {
let mut resp_header = [0u8; 16];
- resp_header[0..8].copy_from_slice(&self.request_id.to_le_bytes());
- resp_header[8..12].copy_from_slice(&self.status.to_le_bytes());
- resp_header[12..16].copy_from_slice(&self.result.to_le_bytes());
+ resp_header[0..8].copy_from_slice(&r.request_id.to_le_bytes());
+ resp_header[8..12].copy_from_slice(&r.status.to_le_bytes());
+ resp_header[12..16].copy_from_slice(&r.result.to_le_bytes());
resp_header
}
}