pub fn first_card() -> io::Result<Device> {
        let mut cards: Vec<_> = try!(Device::cards()).collect();
        cards.sort();
        match cards.first() {
            None => Err(io::Error::new(io::ErrorKind::NotFound,
                                       "No cards found in /dev/dri".to_string())),
            Some(p) => Device::open(p)
        }
    }
/// Grab the first card availble (by filename order), this is
/// probably not what you want to do. Except when:
/// 
/// * You have a stupid demo application (like the ones in ../examples)
/// * Fallback for a configurable program that is not configured.
/// * You have a completely bespoke system and you know which card should be there.
///   (eg embedded systems)
///
/// (i.e don't be asinine and force future users to use hacks to
/// make your program work on multicard systems)
Grab the first card availble (by filename order), this is
probably not what you want to do. Except when.

You have a stupid demo application (like the ones in ../examples)
Fallback for a configurable program that is not configured.
You have a completely bespoke system and you know which card should be there.


Grab the first card availble ( by filename order ) this is probably not what you want to do . Except when . You have a stupid demo application ( like the ones in .. / examples ) Fallback for a configurable program that is not configured . You have a completely bespoke system and you know which card should be there .
pub fn first_card() -> io::Result<Device> {
        let mut cards: Vec<_> = try!(Device::cards()).collect();
        cards.sort();
        match cards.first() {
            None => Err(io::Error::new(io::ErrorKind::NotFound,
                                       "No cards found in /dev/dri".to_string())),
            Some(p) => Device::open(p)
        }
    }
pub fn first_card ( ) -> io :: Result < Device > { let mut cards : Vec < _ > = try ! ( Device cards ( ) ) . collect ( ) ; cards . sort ( ) ; match cards . first ( ) { None => Err ( io :: Error :: new ( io :: ErrorKind :: NotFound , " " . to_string ( ) ) ) , Some ( p ) => Device :: open ( p ) } }
Grab the first card availble (by filename order), this is
probably not what you want to do.
Grab the first card availble ( by filename order ) this is probably not what you want to do .