1
2
3
4
5
6
7
8
9
10
11
12
use std::io;

use crate::{repository::Adapter, Record};

impl Adapter for Vec<Record> {
    fn get(&mut self, name: &[u8]) -> Option<io::Result<Record>> {
        self.iter()
            .find(|record| record.name() == name)
            .cloned()
            .map(Ok)
    }
}