git-next/crates/config/src/repo_branches.rs
Paul Campbell ea20afee12
Some checks failed
ci/woodpecker/cron/cron-docker-builder Pipeline was successful
ci/woodpecker/cron/push-next Pipeline was successful
ci/woodpecker/cron/tag-created Pipeline was successful
ci/woodpecker/push/cron-docker-builder Pipeline was successful
ci/woodpecker/push/push-next Pipeline was successful
ci/woodpecker/push/tag-created Pipeline was successful
Rust / build (push) Has been cancelled
refactor: config: use newtype
2024-06-19 08:16:54 +01:00

35 lines
657 B
Rust

use crate::BranchName;
/// Mapped from `.git-next.toml` file at `branches`
#[derive(
Clone,
Hash,
Debug,
PartialEq,
Eq,
PartialOrd,
Ord,
serde::Deserialize,
serde::Serialize,
derive_more::Constructor,
derive_more::Display,
)]
#[display("{},{},{}", main, next, dev)]
pub struct RepoBranches {
main: String,
next: String,
dev: String,
}
impl RepoBranches {
pub fn main(&self) -> BranchName {
BranchName::new(&self.main)
}
pub fn next(&self) -> BranchName {
BranchName::new(&self.next)
}
pub fn dev(&self) -> BranchName {
BranchName::new(&self.dev)
}
}