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:
Allen Webb 2021-01-08 07:48:29 -06:00 committed by Commit Bot
parent 43c0add2b7
commit 191444797d
2 changed files with 6 additions and 0 deletions

1
.gitignore vendored
View file

@ -5,3 +5,4 @@ target/
**/Cargo.lock
!/Cargo.lock
lcov.info
.idea

View file

@ -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 {