liboxen 0.53.0

Oxen is a fast data version control system, built with machine learning training data in mind. Designed to handle terabytes of data with ease, using a workflow similar to git. Version both structured and unstructured data of any modality: text, images, video, audio, CSV, Parquet, JSONL, model checkpoints, and more. liboxen is the embeddable core library behind the oxen CLI and server, which power fine tuning and inference pipelines for multimodal LLMs, image models, and video models on Oxen.ai.
//! # PathBufError
//!
//! Struct that wraps a PathBuf and implements the necessary traits for errors.
//!

use std::fmt;
use std::path::{Path, PathBuf};

#[derive(Debug)]
pub struct PathBufError(PathBuf);

impl From<&Path> for PathBufError {
    fn from(p: &Path) -> Self {
        PathBufError(p.to_path_buf())
    }
}

impl From<PathBuf> for PathBufError {
    fn from(p: PathBuf) -> Self {
        PathBufError(p)
    }
}

impl std::fmt::Display for PathBufError {
    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
        write!(f, "{}", self.0.to_string_lossy())
    }
}

impl std::error::Error for PathBufError {}