Implement From over Into

https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into
This commit is contained in:
Jake Howard
2021-03-27 14:19:57 +00:00
parent 9f1240d8d9
commit 6b1daeba05
2 changed files with 20 additions and 20 deletions

View File

@ -131,12 +131,12 @@ struct RegisterResponseCopy {
pub error_code: Option<NumberOrString>,
}
impl Into<RegisterResponse> for RegisterResponseCopy {
fn into(self) -> RegisterResponse {
impl From<RegisterResponseCopy> for RegisterResponse {
fn from(r: RegisterResponseCopy) -> RegisterResponse {
RegisterResponse {
registration_data: self.registration_data,
version: self.version,
client_data: self.client_data,
registration_data: r.registration_data,
version: r.version,
client_data: r.client_data,
}
}
}