kernel_cmdline, cros_async: impl From instead of Into

As recommended by the clippy from_over_into warning, allow conversion to
Vec<u8> by adding a more flexible From impl instead of Into.

https://rust-lang.github.io/rust-clippy/master/index.html#from_over_into

BUG=None
TEST=bin/clippy

Change-Id: Iaa6455b11629846e5ce9bc9be4a6cae0baf87d5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2862580
Reviewed-by: Zach Reizner <zachr@chromium.org>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2021-04-30 12:42:15 -07:00 committed by Commit Bot
parent 435f608501
commit 2924f8bfb7
2 changed files with 6 additions and 6 deletions

View file

@ -68,9 +68,9 @@ impl From<Vec<u8>> for VecIoWrapper {
}
}
impl Into<Vec<u8>> for VecIoWrapper {
fn into(self) -> Vec<u8> {
self.inner.into()
impl From<VecIoWrapper> for Vec<u8> {
fn from(v: VecIoWrapper) -> Vec<u8> {
v.inner.into()
}
}

View file

@ -139,9 +139,9 @@ impl Cmdline {
}
}
impl Into<Vec<u8>> for Cmdline {
fn into(self) -> Vec<u8> {
self.line.into_bytes()
impl From<Cmdline> for Vec<u8> {
fn from(c: Cmdline) -> Vec<u8> {
c.line.into_bytes()
}
}