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

Adding a named parameter #392

Closed
dsgipe opened this issue Dec 5, 2024 · 1 comment
Closed

Adding a named parameter #392

dsgipe opened this issue Dec 5, 2024 · 1 comment

Comments

@dsgipe
Copy link

dsgipe commented Dec 5, 2024

Suppose I created params with

let mut parameters = params! {
    "foo" =>  2,
};

how do I add one? For example:

parameters.insert(bar, 1).

thanks!

@dsgipe
Copy link
Author

dsgipe commented Dec 5, 2024

I figured it out.

if let Params::Named(ref mut map) = params (
map. insert( "bar".as_bytes().to_vec(), Value::from(1));

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

2 participants