Skip to content

[Feature Request] - MockComponent::query_ref query without cloning #121

@hasezoey

Description

@hasezoey

Description

While putting together #120 and some other things, i noticed that it is unnecessary that MockComponent::query returns a value that is not a reference.
This keep this backwards compatible, this could be implemented as a new optional function.

Changes

When wanting to keep backwards compat, add a new optional function that has the signature of:

fn(&self, attr: Attribute) -> Option<&AttrValue>;

If not wanting backwards compat (ie a new major version), consider changing query directly.

For reference, the following is the current (as of 3.1.0 definition):

fn query(&self, attr: Attribute) -> Option<AttrValue>;

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions