Skip to content

Conversation

ids1024
Copy link
Member

@ids1024 ids1024 commented Mar 6, 2025

It seems odd for this to return an owned value, when ::name() doesn't. And it is useful to get a reference to the ValueType, so ValueType::convert_value can be used and just use the lifetime of the Info instead of the cloned ValueType.

I assume there's no reason not to do this, since callers can still clone as needed.

As a small API break, I think this should be merged whenever the next semver bump to the crate happens to be.

@MarijnS95
Copy link
Contributor

It was probably intended as a cheap Copy type, except that the presence of EnumValues (with Vecs) no longer makes that cheaply possible?

@ids1024
Copy link
Member Author

ids1024 commented Mar 6, 2025

Yeah, I was wondering about that, but haven't check the history. If it were a Copy type the current API would be good, but not now that it contains a couple Vecs (if it's an enum), and Value<'_> holds a reference to it.

@Drakulix
Copy link
Member

I think this is a good change, is this ready for merge?

@ids1024
Copy link
Member Author

ids1024 commented Jul 25, 2025

I think the only reason I marked this as a draft is because it's a breaking change. So if there's going to be a breaking release, it should be mergable.

@Drakulix Drakulix marked this pull request as ready for review July 25, 2025 17:04
@MarijnS95
Copy link
Contributor

Didn't we already land a bunch of breaking changes? This can probably be merged after a rebase, I don't see the CI being unhappy with it after that :)

@Drakulix
Copy link
Member

yeah, I think this just needs a rebase

It seems odd for this to return an owned value, when `::name()` doesn't.
And it is useful to get a reference to the `ValueType`, so
`ValueType::convert_value` can be used and just use the lifetime of the
`Info` instead of the cloned `ValueType.`

I assume there's no reason not to do this, since callers can still clone
as needed.
@ids1024
Copy link
Member Author

ids1024 commented Jul 29, 2025

CI passing, after also updating a line in planes example.

@Drakulix Drakulix merged commit 1b57107 into Smithay:develop Jul 30, 2025
16 checks passed
@Drakulix
Copy link
Member

thx!

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.

3 participants