summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Pomykalov <gleb@lancastr.com>2019-02-18 22:35:42 +0300
committerGleb Pomykalov <gleb@lancastr.com>2019-02-18 22:35:42 +0300
commit97b5b3494beb1d6a45b86ff55485864d4eabb7df (patch)
tree534a89b3146ed71a30e6c449eafdf7ffa0f2e748
parentb08ae2ccd63d6756c94fcb7c8728ae96d98a73bb (diff)
downloadrust-libc-97b5b3494beb1d6a45b86ff55485864d4eabb7df.tar.gz
improve naming
-rw-r--r--src/unix/notbsd/android/mod.rs8
-rw-r--r--src/unix/notbsd/linux/mod.rs8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/unix/notbsd/android/mod.rs b/src/unix/notbsd/android/mod.rs
index 88a1af96b2..089780f5bb 100644
--- a/src/unix/notbsd/android/mod.rs
+++ b/src/unix/notbsd/android/mod.rs
@@ -508,14 +508,14 @@ cfg_if! {
}
impl af_alg_iv {
- unsafe fn iv(&self) -> &[u8] {
+ unsafe fn as_slice(&self) -> &[u8] {
::std::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize)
}
}
impl PartialEq for af_alg_iv {
fn eq(&self, other: &af_alg_iv) -> bool {
- *self.iv() == *other.iv()
+ *self.as_slice() == *other.as_slice()
}
}
@@ -524,14 +524,14 @@ cfg_if! {
impl ::fmt::Debug for af_alg_iv {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("af_alg_iv")
- .field("iv", self.iv())
+ .field("iv", self.as_slice())
.finish()
}
}
impl ::hash::Hash for af_alg_iv {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
- self.iv().hash(state);
+ self.as_slice().hash(state);
}
}
}
diff --git a/src/unix/notbsd/linux/mod.rs b/src/unix/notbsd/linux/mod.rs
index c41e1a02b0..df0cce7bd3 100644
--- a/src/unix/notbsd/linux/mod.rs
+++ b/src/unix/notbsd/linux/mod.rs
@@ -727,14 +727,14 @@ cfg_if! {
}
impl af_alg_iv {
- unsafe fn iv(&self) -> &[u8] {
+ unsafe fn as_slice(&self) -> &[u8] {
::std::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize)
}
}
impl PartialEq for af_alg_iv {
fn eq(&self, other: &af_alg_iv) -> bool {
- *self.iv() == *other.iv()
+ *self.as_slice() == *other.as_slice()
}
}
@@ -743,14 +743,14 @@ cfg_if! {
impl ::fmt::Debug for af_alg_iv {
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
f.debug_struct("af_alg_iv")
- .field("iv", self.iv())
+ .field("iv", self.as_slice())
.finish()
}
}
impl ::hash::Hash for af_alg_iv {
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
- self.iv().hash(state);
+ self.as_slice().hash(state);
}
}
}