mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 21:53:23 +00:00
18 lines
321 B
Rust
18 lines
321 B
Rust
|
#![allow(dead_code)]
|
||
|
|
||
|
struct Foo;
|
||
|
|
||
|
impl<'a> std::convert::TryFrom<&'a String> for Foo {
|
||
|
type Error = std::convert::Infallible;
|
||
|
|
||
|
fn try_from(_: &'a String) -> Result<Self, Self::Error> {
|
||
|
Ok(Foo)
|
||
|
}
|
||
|
}
|
||
|
|
||
|
fn find<E>(_: impl std::convert::TryInto<Foo, Error = E>) {}
|
||
|
|
||
|
fn main() {
|
||
|
find(&String::new());
|
||
|
}
|