fn path_from_key(&self, key: &[u8]) -> path::PathBuf {
        let hex = hex::encode(key);
        let mut buf = self.opts.path.clone();

        // push segments of key as paths to the PathBuf. If the hex isn't long enough, then push
        // "__" instead.
        for n in (0..self.opts.dir_depth).map(|x| x as usize * 2) {
            let n_end = n + 2;
            buf.push(if n_end >= hex.len() {
                "__"
            } else {
                &hex[n..n_end]
            })
        }
        buf.push(&hex);
        buf
    }
/// Creates a PathBuf based on the key provided
Creates a PathBuf based on the key provided
Creates a PathBuf based on the key provided
fn path_from_key(&self, key: &[u8]) -> path::PathBuf {
        let hex = hex::encode(key);
        let mut buf = self.opts.path.clone();
        // push segments of key as paths to the PathBuf. If the hex isn't long enough, then push
        // "__" instead.
        for n in (0..self.opts.dir_depth).map(|x| x as usize * 2) {
            let n_end = n + 2;
            buf.push(if n_end >= hex.len() {
                "__"
            } else {
                &hex[n..n_end]
            })
        }
        buf.push(&hex);
        buf
    }
fn path_from_key ( & self , key : & [ u8 ] ) -> path :: PathBuf { let hex = hex :: encode ( key ) ; let mut buf = self . opts . path . clone ( ) ; // push segments of key as paths to the PathBuf. If the hex isn't long enough, then push // "__" instead. for n in ( 0 .. self . opts . dir_depth ) . map ( | x | x as usize * 2 ) { let n_end = n + 2 ; buf . push ( if n_end >= hex . len ( ) { " " } else { & hex [ n .. n_end ] } ) } buf . push ( & hex ) ; buf }
Creates a PathBuf based on the key provided
Creates a PathBuf based on the key provided
&self
key
&[u8]
&self
key
&[u8]