pub fn load(filename: &str) -> Result<MapData, Error> {
    let f = File::open(filename)?;
    let map: MapData = serde_json::from_reader(f)?;
    Ok(map)
}
/// Loads the supplied .crocotile file
///
/// Loads the supplied file, parses it, and returns a `MapData` containing
/// configuration and all the models within the map.
///
/// # Panics
/// No panics should occur with this library - if you find one, please raise a
/// GitHub issue for it.
///
/// # Errors
/// Errors are wrapped using the `failure` crate. If you need to interop with
/// code that doesn't presently use `failure`, wrap the errors in a `Compat`.
///
/// # Examples
///
/// Loading a file:
///
/// ```
/// use dot_crocotile::*;
///
/// let map = load("src/resources/green.crocotile").unwrap();
/// assert_eq!(16, map.config.tilesize_x);
/// assert_eq!(1, map.model.len());
/// ```
Loads the supplied .crocotile file
Loads the supplied file, parses it, and returns a `MapData` containing
configuration and all the models within the map.
Loads the supplied . crocotile file Loads the supplied file parses it and returns a ` MapData ` containing configuration and all the models within the map .
pub fn load(filename: &str) -> Result<MapData, Error> {
    let f = File::open(filename)?;
    let map: MapData = serde_json::from_reader(f)?;
    Ok(map)
}
pub fn load ( filename : & str ) -> Result < MapData , Error > { let f = File :: open ( filename ) ? ; let map : MapData = serde_json :: from_reader ( f ) ? ; Ok ( map ) }
Loads the supplied .crocotile file
Loads the supplied file, parses it, and returns a `MapData` containing
configuration and all the models within the map.
Loads the supplied . crocotile file Loads the supplied file parses it and returns a ` MapData ` containing configuration and all the models within the map .
filename
&str
filename
&str
panics
No panics should occur with this library - if you find one, please raise a
GitHub issue for it.
No panics should occur with this library - if you find one please raise a GitHub issue for it .
errors
Errors are wrapped using the `failure` crate. If you need to interop with
code that doesn't presently use `failure`, wrap the errors in a `Compat`.
Errors are wrapped using the ` failure ` crate . If you need to interop with code that doesn ' t presently use ` failure ` wrap the errors in a ` Compat ` .
examples
Loading a file.

```
use dot_crocotile::*.

let map = load("src/resources/green.crocotile").unwrap();
assert_eq!(16, map.config.tilesize_x);
assert_eq!(1, map.model.len());
```
Loading a file . ` ` ` use dot_crocotile :: * . let map = load ( " src / resources / green . crocotile " ) . unwrap () ; assert_eq! ( 16 map . config . tilesize_x ) ; assert_eq! ( 1 map . model . len () ) ; ` ` `