Skip to content
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

Load default values from Rust expressions like constants #15

Open
LukasKalbertodt opened this issue Oct 21, 2022 · 2 comments
Open

Load default values from Rust expressions like constants #15

LukasKalbertodt opened this issue Oct 21, 2022 · 2 comments

Comments

@LukasKalbertodt
Copy link
Owner

Right now default only allows a handful of different expression types. But sometimes you might want to store the value in a Rust constant or call a function or something like that. Maybe we want to allow that?

The obvious problem here is printing that in the config template. Either the user specifies default_in_template = ... for us to use, or we require that the value implements Serialize and somehow do it like this? Both seems rather meh.

And maybe basically no one wants this feature anyway. Or maybe we shouldn't even allow it as the default value should be expressible in simple expressions: that's whats in the config file in the end, after all.

@noahdotpy
Copy link

I think that calling a function (for example to get the home directory of the user) at runtime is an extremely common procedure in making config defaults which use any type of file path.

@synek317
Copy link

synek317 commented Dec 2, 2024

Is this crate actively maintained? I think I could try to help with this feature which would be very useful imho.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants