fixed test, now it doesn't use a fundemental type
i.e. `Box`, instead it now uses `Vec`
This commit is contained in:
parent
db9fe1c86e
commit
7dd078f53f
1 changed files with 5 additions and 4 deletions
|
|
@ -32,12 +32,13 @@ impl<T> From<Foo<T>> for Box<T> {
|
|||
}
|
||||
*/
|
||||
|
||||
impl<T> Into<Box<T>> for Foo<T> {
|
||||
fn into(self) -> Box<T> {
|
||||
Box::new(self.t)
|
||||
impl<T> Into<Vec<T>> for Foo<T> {
|
||||
fn into(self) -> Vec<T> {
|
||||
vec![self.t]
|
||||
}
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
let _: Result<Box<i32>, !> = Foo { t: 10 }.try_into();
|
||||
let _: Result<Vec<i32>, !> = Foo { t: 10 }.try_into();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue