This is duplicated in astencode. Maybe a `.unwrap_one()` method?