quake-util 0.4.0

A utility library for using Quake file formats
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use core::cell::Cell;

pub trait CellOptionExt<T> {
    fn steal(&self) -> T;

    fn into_unwrapped(self) -> T;
}

impl<T> CellOptionExt<T> for Cell<Option<T>> {
    fn steal(&self) -> T {
        self.take().expect("Empty cell option")
    }

    fn into_unwrapped(self) -> T {
        self.into_inner().expect("Empty cell option")
    }
}