-
Notifications
You must be signed in to change notification settings - Fork 8
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
Explore ways to make the LayerEnv
API more consise
#73
Comments
Also another related comment from that PR: Originally posted by @schneems in https://github.com/Malax/libcnb.rs/pull/30#discussion_r698790544 I was confused by this That makes sense as I type it out, but it was unclear on first pass. Right now I'm trying to think of cases where we would want to assign to the current env but have it not be build. I'm not sure I can come up with any. I'm also left somewhat wanting to compress/combine LayerEnv and Env updates. It's a two step process but seems like I always want to do them in lockstep. I would need to see it utilized in a buildpack, but I bet that I'll insert the env var and then forget to update the current env. Maybe some interface like this would help prevent that situation: layer_env.insert_and_apply(TargetLifecycle::All, ModificationBehavior::Default, "VAR2", "default", &env); |
LayerEnv
API more consise
Closing as resolved, given the above. |
I've split this review comment out of #30 so it doesn't get lost, since the PR has already been merged.
Originally posted by @schneems in https://github.com/Malax/libcnb.rs/pull/30#discussion_r698781818
As I'm looking at this code, I'm curious if there's a more concise way to represent this logic:
For example (without implementation constraints) could be:
Or something like:
What you've got now is great to move forward. As I'm trying to figure out what makes a "good" interface in Rust, I would be interested to hear your thoughts (Again, non-blocking...we can take it offline to chat).
The text was updated successfully, but these errors were encountered: