chore: fmt

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-08-01 15:02:05 +02:00
parent 8cd68d569b
commit 8b83b9c14d
7 changed files with 12 additions and 17 deletions

View File

@@ -40,7 +40,7 @@ pub fn get_from_environment(vars: std::env::Vars) -> PleaseConfigBuilder {
}
pub fn detect_environment(vars: &HashMap<String, String>) -> ExecutionEnvironment {
if let Some(_) = vars.get("DRONE".into()) {
if vars.get("DRONE").is_some() {
return ExecutionEnvironment::Drone;
}

View File

@@ -25,19 +25,19 @@ pub struct PleaseConfig {
}
impl PleaseConfig {
pub fn get_owner<'a>(&'a self) -> &'a str {
pub fn get_owner(&self) -> &str {
&self.project.owner
}
pub fn get_repository<'a>(&'a self) -> &'a str {
pub fn get_repository(&self) -> &str {
&self.project.repository
}
pub fn get_source<'a>(&'a self) -> &'a PathBuf {
pub fn get_source(&self) -> &PathBuf {
&self.project.source
}
pub fn get_branch<'a>(&'a self) -> &'a str {
pub fn get_branch(&self) -> &str {
&self.project.branch
}
pub fn get_api_url<'a>(&'a self) -> &'a str {
pub fn get_api_url(&self) -> &str {
&self.settings.api_url
}
}
@@ -90,6 +90,6 @@ impl PleaseConfigBuilder {
a.merge(x).clone()
});
Ok(final_config.try_into()?)
final_config.try_into()
}
}

View File

@@ -1,4 +1,4 @@
use std::{default, path::PathBuf};
use std::path::PathBuf;
use serde::{Deserialize, Serialize};
@@ -35,7 +35,7 @@ impl PleaseConfigBuilder {
Some(settings) => settings,
};
if let Some(mut project) = config.project {
if let Some(project) = config.project {
if let Some(owner) = project.owner {
fproject.owner = Some(owner);
}
@@ -51,7 +51,7 @@ impl PleaseConfigBuilder {
self.project = Some(fproject);
}
if let Some(mut settings) = config.settings {
if let Some(settings) = config.settings {
if let Some(api_url) = settings.api_url {
fsettings.api_url = Some(api_url);
}