-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Assorted minor refactors and performance nits #519
Conversation
for mut env in context.environment { | ||
if let Some(_is_set) = env.set { | ||
if let Some(profile) = &env.profile { | ||
let credential = profiles.iter().rev().find(|c| &c.name == profile).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same idea as the previous code (iterate and find the last matching element) but starting from the end, doing less work overall
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clean @vrmiguel
@@ -43,7 +43,7 @@ pub fn execute(verbose: bool) -> Result<(), anyhow::Error> { | |||
let mut file_path = FileUtils::get_current_working_dir(); | |||
file_path.push_str("/tembo.toml"); | |||
|
|||
let contents = fs::read_to_string(file_path.clone())?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Looks good. Just a minor comment on the error msg.
I'm familiaring myself with the tembo-cli code and thought it was a good opportunity to suggest these minor changes