free-rusty-maker/src/lib.rs

31 lines
785 B
Rust

#![warn(missing_docs)]
//! This crates contains the (future) rusty game.
use std::{fmt, io, result};
/// This module contains all the tools needed for the game.
pub mod engine;
/// This is the error type of this library.
#[derive(Debug)]
pub enum Error {
/// An error occured while trying to save a file.
Save(io::Error),
/// An error occured while trying to load a file.
Load(io::Error),
}
impl fmt::Display for Error {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match *self {
Error::Save(ref e) => write!(fmt, "couldn't save file: {}", e),
Error::Load(ref e) => write!(fmt, "couldn't load file: {}", e),
}
}
}
/// This is the result type of this library.
type Result<T> = result::Result<T, Error>;