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.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
For standart functions rust deduct conversion from Box::new(something) to Box<dyn Trait_name>, but in async we need use as Box<dyn Trait_name>:
Box::new(something)
Box<dyn Trait_name>
as Box<dyn Trait_name>
pub trait Trait: Send {} #[derive(Default)] struct Test; impl Trait for Test {} pub fn test() -> Box<dyn Trait> { Box::new(Test::default()) } pub async fn test_async() -> Box<dyn Trait> { Box::new(Test::default()) as Box<dyn Trait> }
So I think it's may be better without as Box...
as Box...
The text was updated successfully, but these errors were encountered:
Duplicate of #60424
Sorry, something went wrong.
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
For standart functions rust deduct conversion from
Box::new(something)
toBox<dyn Trait_name>
, but in async we need useas Box<dyn Trait_name>
:So I think it's may be better without
as Box...
The text was updated successfully, but these errors were encountered: