free-rusty-maker/src/lib.rs

31 lines
785 B
Rust
Raw Permalink Normal View History

2018-10-02 14:12:52 +02:00
#![warn(missing_docs)]
//! This crates contains the (future) rusty game.
2020-04-21 19:29:24 +02:00
use std::{fmt, io, result};
2019-03-30 13:34:09 +01:00
2018-10-02 21:48:19 +02:00
/// This module contains all the tools needed for the game.
pub mod engine;
2019-03-30 13:34:09 +01:00
/// 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>;