mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-10-23 04:46:29 +00:00
data_model: Ad is_empty to fix clippy warning.
warning: item `sys::IoSliceMut<'a>` has a public `len` method but no corresponding `is_empty` method --> /mnt/host/source/src/platform/crosvm/data_model/src/sys.rs:23:1 Also, add .idea to the .gitignore to ignore Intelij projects. BUG=None TEST=(cd data_model && cargo clippy) Change-Id: I3ce0dc49bcb75ac16bc9ae3b6eec8d34f25919c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosvm/+/2616806 Reviewed-by: Noah Gold <nkgold@google.com> Reviewed-by: Dylan Reid <dgreid@chromium.org> Tested-by: Allen Webb <allenwebb@google.com> Commit-Queue: Allen Webb <allenwebb@google.com>
This commit is contained in:
parent
43c0add2b7
commit
191444797d
2 changed files with 6 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -5,3 +5,4 @@ target/
|
|||
**/Cargo.lock
|
||||
!/Cargo.lock
|
||||
lcov.info
|
||||
.idea
|
||||
|
|
|
@ -48,6 +48,11 @@ impl<'a> IoSliceMut<'a> {
|
|||
self.iov.iov_len as usize
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.iov.iov_len == 0
|
||||
}
|
||||
|
||||
/// Gets a const pointer to this slice's memory.
|
||||
#[inline]
|
||||
pub fn as_ptr(&self) -> *const u8 {
|
||||
|
|
Loading…
Reference in a new issue