Skip to content

Commit

Permalink
Use ManagedSlice in SliceArpCache.
Browse files Browse the repository at this point in the history
whitequark committed Jan 10, 2017
1 parent 839eae8 commit 92e9fcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/iface/arp_cache.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use managed::Managed;
use managed::ManagedSlice;

use wire::{EthernetAddress, IpAddress};

@@ -33,7 +33,7 @@ pub trait Cache {
/// let mut arp_cache = SliceArpCache::new(&mut arp_cache_storage[..]);
/// ```
pub struct SliceCache<'a> {
storage: Managed<'a, [(IpAddress, EthernetAddress, usize)]>,
storage: ManagedSlice<'a, (IpAddress, EthernetAddress, usize)>,
counter: usize
}

@@ -43,7 +43,7 @@ impl<'a> SliceCache<'a> {
/// # Panics
/// This function panics if `storage.len() == 0`.
pub fn new<T>(storage: T) -> SliceCache<'a>
where T: Into<Managed<'a, [(IpAddress, EthernetAddress, usize)]>> {
where T: Into<ManagedSlice<'a, (IpAddress, EthernetAddress, usize)>> {
let mut storage = storage.into();
if storage.len() == 0 {
panic!("ARP slice cache created with empty storage")

0 comments on commit 92e9fcb

Please sign in to comment.