as extensively discussed in rust-lang/rust#91639, elided lifetimes in paths should be visible and can lead to confusion if they are omitted. The rust_2018_idoms warning should therefore generally be enabled at crate-level.
An example is something like
struct SimpleCamera<'a> {
camera: ActiveCamera<'a>,
}
impl<'a> SimpleCamera<'a> {
fn new() -> anyhow::Result<Self> {
let manager = CameraManager::new()?;
let cameras = manager.cameras();
let camera = cameras.get(0).unwrap();
let active_camera = camera.acquire()?;
Ok(Self {
camera: active_camera,
})
}
}
where you might confused why this isn't working, only looking at the return types of CameraManager::cameras() and Camera::acquire() (which suggest that you get a completely owned value, i.e. no lifetimes and references).
This PR is gonna clash with #6, so I guess #6 should be merged first.
as extensively discussed in rust-lang/rust#91639, elided lifetimes in paths should be visible and can lead to confusion if they are omitted. The
rust_2018_idoms
warning should therefore generally be enabled at crate-level.An example is something like
where you might confused why this isn't working, only looking at the return types of
CameraManager::cameras()
andCamera::acquire()
(which suggest that you get a completely owned value, i.e. no lifetimes and references).This PR is gonna clash with #6, so I guess #6 should be merged first.