refactor: rename name to forge_name for consistency

This commit is contained in:
Paul Campbell 2024-04-23 06:53:34 +01:00
parent 8b56a185d3
commit fc1c79620c
2 changed files with 5 additions and 5 deletions

View file

@ -262,7 +262,7 @@ impl secrecy::ExposeSecret<String> for ApiToken {
/// The derived information about a Forge, used to create interactions with it
#[derive(Clone, Debug)]
pub struct ForgeDetails {
pub name: ForgeName,
pub forge_name: ForgeName,
pub forge_type: ForgeType,
pub hostname: Hostname,
pub user: User,
@ -273,7 +273,7 @@ pub struct ForgeDetails {
impl From<(&ForgeName, &ForgeConfig)> for ForgeDetails {
fn from(forge: (&ForgeName, &ForgeConfig)) -> Self {
Self {
name: forge.0.clone(),
forge_name: forge.0.clone(),
forge_type: forge.1.forge_type.clone(),
hostname: forge.1.hostname(),
user: forge.1.user(),
@ -343,7 +343,7 @@ impl RepoDetails {
branch: BranchName(server_repo_config.branch.clone()),
gitdir: server_repo_config.gitdir(),
forge: ForgeDetails {
name: forge_name.clone(),
forge_name: forge_name.clone(),
forge_type: forge.forge_type.clone(),
hostname: forge.hostname(),
user: forge.user(),
@ -368,7 +368,7 @@ impl Display for RepoDetails {
write!(
f,
"{}/{} ({}): {}:{}/{} @ {}",
self.forge.name,
self.forge.forge_name,
self.repo_alias,
self.forge.forge_type,
self.forge.hostname,

View file

@ -5,7 +5,7 @@ use crate::server::config::{
pub fn forge_details(n: u32, forge_type: ForgeType) -> ForgeDetails {
ForgeDetails {
name: forge_name(n),
forge_name: forge_name(n),
forge_type,
hostname: hostname(n),
user: user(n),