Could be `Some(from.id) == to.as_ref().map(|ty| ty.id)`, I guess.