We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
deref
Box<str>
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
reposted:
I have this code, it does not compile. I am trying to deeply match a Box inside of a pattern, but the error is: expected str, found `&str` but there's no good way to match Box in a deeply nested pattern... #![feature(box_patterns)] struct Type { pub name: Box<str>, pub generics: Option<Vec<Type>> } fn main(){ let kind = Type { name: "User".into(), generics: Some(Vec::new()) }; match kind { Type { name: box "User", generics } => {} _ => unimplemented!() } }
I have this code, it does not compile. I am trying to deeply match a Box inside of a pattern, but the error is:
expected str, found `&str`
but there's no good way to match Box in a deeply nested pattern...
#![feature(box_patterns)] struct Type { pub name: Box<str>, pub generics: Option<Vec<Type>> } fn main(){ let kind = Type { name: "User".into(), generics: Some(Vec::new()) }; match kind { Type { name: box "User", generics } => {} _ => unimplemented!() } }
Is there any kind of proposal to address the deref for this specific case?
The text was updated successfully, but these errors were encountered:
Box is planned to be covered by the initial version of deref patterns, regardless of the inner type.
Sorry, something went wrong.
Great to hear. Can't wait for this feature. Any idea as to how long this process usually takes?
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
reposted:
Is there any kind of proposal to address the deref for this specific case?
The text was updated successfully, but these errors were encountered: