-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Tracking issue for Cow::is_borrowed and Cow::is_owned #65143
Copy link
Copy link
Open
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
B-unstableBlocker: Implemented in the nightly compiler and unstable.Blocker: Implemented in the nightly compiler and unstable.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCLibs-TrackedLibs issues that are tracked on the team's project board.Libs issues that are tracked on the team's project board.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I just tried to use these in my own code and was kind of shocked they didn't exist.
Justification: this seems like a common Rust pattern. We have
is_someandis_noneforOption,is_okandis_errforResult, etc., so, it seems pretty fair to haveis_borrowedandis_ownedforCow.Having
as_borrowedandas_ownedwouldn't really make much sense, as a simple&and&mut/to_mutcover those use cases. But, these check functions are pretty useful on their own.Unresolved question: do we want to ship these or defer to
matches!and the future possibility ofis?