Skip to content

Commit 97b5b34

Browse files
author
Gleb Pomykalov
committed
improve naming
1 parent b08ae2c commit 97b5b34

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/unix/notbsd/android/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,14 +508,14 @@ cfg_if! {
508508
}
509509

510510
impl af_alg_iv {
511-
unsafe fn iv(&self) -> &[u8] {
511+
unsafe fn as_slice(&self) -> &[u8] {
512512
::std::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize)
513513
}
514514
}
515515

516516
impl PartialEq for af_alg_iv {
517517
fn eq(&self, other: &af_alg_iv) -> bool {
518-
*self.iv() == *other.iv()
518+
*self.as_slice() == *other.as_slice()
519519
}
520520
}
521521

@@ -524,14 +524,14 @@ cfg_if! {
524524
impl ::fmt::Debug for af_alg_iv {
525525
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
526526
f.debug_struct("af_alg_iv")
527-
.field("iv", self.iv())
527+
.field("iv", self.as_slice())
528528
.finish()
529529
}
530530
}
531531

532532
impl ::hash::Hash for af_alg_iv {
533533
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
534-
self.iv().hash(state);
534+
self.as_slice().hash(state);
535535
}
536536
}
537537
}

src/unix/notbsd/linux/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -727,14 +727,14 @@ cfg_if! {
727727
}
728728

729729
impl af_alg_iv {
730-
unsafe fn iv(&self) -> &[u8] {
730+
unsafe fn as_slice(&self) -> &[u8] {
731731
::std::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize)
732732
}
733733
}
734734

735735
impl PartialEq for af_alg_iv {
736736
fn eq(&self, other: &af_alg_iv) -> bool {
737-
*self.iv() == *other.iv()
737+
*self.as_slice() == *other.as_slice()
738738
}
739739
}
740740

@@ -743,14 +743,14 @@ cfg_if! {
743743
impl ::fmt::Debug for af_alg_iv {
744744
fn fmt(&self, f: &mut ::fmt::Formatter) -> ::fmt::Result {
745745
f.debug_struct("af_alg_iv")
746-
.field("iv", self.iv())
746+
.field("iv", self.as_slice())
747747
.finish()
748748
}
749749
}
750750

751751
impl ::hash::Hash for af_alg_iv {
752752
fn hash<H: ::hash::Hasher>(&self, state: &mut H) {
753-
self.iv().hash(state);
753+
self.as_slice().hash(state);
754754
}
755755
}
756756
}

0 commit comments

Comments
 (0)