fn get_cursor_head_oid(&self) -> Option { self.events[0..1].iter().find_map(|event| -> Option { match &event { Event::RefUpdateEvent {..} => { match git2::Oid::from_str(&new_ref) { Ok(oid) => Some(oid), Err(_) => { eprintln!("Expected HEAD new_ref to point to an OID; instead pointed to: {:?}", new_ref); None }, } }, } }) }