oceanpkg-shared 0.1.1

Shared reusable library for the Ocean package manager.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::path::{Path, PathBuf};

/// Extended functionality for
/// [`PathBuf`](https://doc.rust-lang.org/std/path/struct.PathBuf.html).
pub trait PathBufExt {
    /// Like `join`, only reusing the underlying buffer.
    fn pushing<P: AsRef<Path>>(self, path: P) -> PathBuf;
}

impl PathBufExt for PathBuf {
    fn pushing<P: AsRef<Path>>(mut self, path: P) -> PathBuf {
        self.push(path);
        self
    }
}