(add-hook 'find-file-hook
    (lambda ()
        (let ((buffer (current-buffer)))
            (neotree-find (projectile-project-root))
            (set-buffer buffer))))use std::iter::Iterator;
use std::str::Split;

pub struct Path
{
    path: String,


impl Path
{
    pub fn new(path: String) -> Self
    {
        Self{path}
    }

    pub fn obj_name_iter<'a>(&'a self) -> Split<'a, char>
    {
        self.path.split('/').clone()
    }

    pub fn split_at_base(&self) -> (Path, String)
    {
        let tokens = self.path.split('/').collect::<Vec<&str>]>();
        let base = Path::new(tokens[0..tokens.len()-1]
                             .join("/")
                             .map(|sl| sl.to_owned()));
        let file_name = tokens[tokens.len()-1];

        (base,file_name.to_owned())
    }
}
