Remove compatibility code before 1.64 (#3379)

This commit is contained in:
Kaede Hoshikawa 2023-08-19 22:57:16 +09:00 committed by GitHub
parent 42e1890f03
commit b28e69a574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -452,25 +452,9 @@ mod feat_csr_ssr {
}
}
#[rustversion::before(1.63)]
#[inline]
pub(super) fn arch_get_component(&self) -> Option<impl Deref<Target = COMP> + '_> {
self.state.try_borrow().ok().and_then(|state_ref| {
state_ref.as_ref()?;
Some(Ref::map(state_ref, |state| {
state
.as_ref()
.and_then(|m| m.downcast_comp_ref::<COMP>())
.unwrap()
}))
})
}
#[rustversion::since(1.63)]
#[inline]
pub(super) fn arch_get_component(&self) -> Option<impl Deref<Target = COMP> + '_> {
self.state.try_borrow().ok().and_then(|state_ref| {
// Ref::filter_map is only available since 1.63
Ref::filter_map(state_ref, |state| {
state.as_ref().and_then(|m| m.downcast_comp_ref::<COMP>())
})