git-next/crates/config/src/branch_name.rs

18 lines
402 B
Rust
Raw Normal View History

use std::fmt::Formatter;
/// The name of a Branch
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub struct BranchName(pub String);
impl std::fmt::Display for BranchName {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.0)
}
}
impl std::ops::Deref for BranchName {
type Target = String;
fn deref(&self) -> &Self::Target {
&self.0
}
}