Skip to content

Commit

Permalink
Tembo CLI Clippy fix (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuajerin authored Nov 20, 2024
1 parent b2c1b6a commit 7798e70
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 14 deletions.
7 changes: 1 addition & 6 deletions tembo-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,4 @@ openssl = { version = "0.10", features = ["vendored"] }
[dev-dependencies]
assert_cmd = "2.0.8"
predicates = "2.1.5"
rstest = "0.18"

# We can't run integration tests in parallel currently since there are
# conflicts in containers (like traefik) provisioned by various tests
[env]
RUST_TEST_THREADS = "1"
rstest = "0.18"
4 changes: 2 additions & 2 deletions tembo-cli/src/cli/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ pub enum Target {

impl Profile {
pub fn get_tembo_data_host(&self) -> String {
return self.tembo_data_host.trim_end_matches('/').to_string();
self.tembo_data_host.trim_end_matches('/').to_string()
}

pub fn get_tembo_host(&self) -> String {
return self.tembo_host.trim_end_matches('/').to_string();
self.tembo_host.trim_end_matches('/').to_string()
}
}

Expand Down
10 changes: 5 additions & 5 deletions tembo-cli/src/cmd/apply.rs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ fn create_new_instance(
fn get_create_instance(
instance_settings: &InstanceSettings,
) -> Result<CreateInstance, anyhow::Error> {
return Ok(CreateInstance {
Ok(CreateInstance {
cpu: Cpu::from_str(instance_settings.cpu.as_str()).unwrap(),
memory: Memory::from_str(instance_settings.memory.as_str()).unwrap(),
environment: temboclient::models::Environment::from_str(
Expand All @@ -700,7 +700,7 @@ fn get_create_instance(
))),
postgres_configs: Some(Some(get_postgres_config_cloud(instance_settings)?)),
pg_version: Some(instance_settings.pg_version.into()),
});
})
}

fn get_app_services(
Expand Down Expand Up @@ -820,7 +820,7 @@ fn get_patch_instance(
instance: &Instance,
instance_settings: &InstanceSettings,
) -> Result<PatchInstance, anyhow::Error> {
return Ok(PatchInstance {
Ok(PatchInstance {
cpu: Some(Some(Cpu::from_str(instance_settings.cpu.as_str()).unwrap())),
memory: Some(Some(
Memory::from_str(instance_settings.memory.as_str()).unwrap(),
Expand All @@ -845,7 +845,7 @@ fn get_patch_instance(
instance_settings.extensions.clone(),
))),
postgres_configs: Some(Some(get_postgres_config_cloud(instance_settings)?)),
});
})
}

fn get_postgres_config_cloud(
Expand Down Expand Up @@ -1512,7 +1512,7 @@ mod tests {
for (_key, instance_setting) in instance_settings.iter() {
let stack_file = instance_setting.stack_file.clone().unwrap();
let cleaned_stack_file = stack_file.trim_matches('"');
test_dir.push(format!("{}", cleaned_stack_file));
test_dir.push(cleaned_stack_file);

let config_data =
fs::read_to_string(&test_dir).expect("File not found in the directory");
Expand Down
2 changes: 1 addition & 1 deletion tembo-cli/src/tui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub enum TemboCliLog<'a> {
Default(String),
}

impl<'a> fmt::Display for TemboCliLog<'a> {
impl fmt::Display for TemboCliLog<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
TemboCliLog::Gradient(gradient) => write!(f, "{}", gradient),
Expand Down

0 comments on commit 7798e70

Please sign in to comment.