fn apply_if_some<F, R>(queue_opt: Option<Queue>, func: F)where
    F: FnMut(Queue) -> R,