Skip to content

Implement From<bool> for ValueRef#378

Open
rhysd wants to merge 1 commit into
3Hren:masterfrom
rhysd:value-ref-from-bool
Open

Implement From<bool> for ValueRef#378
rhysd wants to merge 1 commit into
3Hren:masterfrom
rhysd:value-ref-from-bool

Conversation

@rhysd

@rhysd rhysd commented Jun 15, 2026

Copy link
Copy Markdown

Value implements From<bool> so we can pass booleans to functions like below.

fn send_some_value(value: impl Into<Value>) {
  // ...
}

send_some_value(true);

However ValueRef doesn't implement it.

fn send_some_value_ref(value: impl Into<ValueRef<'_>>) {
  // ...
}

send_some_value_ref(true); // ERROR

I believe there is no reason not to implement it so I created this PR to add the conversion.

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

Successfully merging this pull request may close these issues.

1 participant