license 0.1.1

A license library.
Documentation
use super::License;
use permissions::*;
use conditions::*;
use limitations::*;

/// The [MIT License](https://opensource.org/licenses/MIT).
#[derive(Clone, Debug, Hash, Eq, PartialEq, Ord, PartialOrd)]
pub struct Mit(String);

impl Mit {
    /// Returns a MIT license.
    #[inline]
    pub fn new(year: i32, name: &str) -> Mit {
        Mit(format!(include_str!("../licenses/MIT"), year, name))
    }
}

impl License for Mit {
    #[inline]
    fn name() -> &'static str {
        "MIT License"
    }

    #[inline]
    fn license(&self) -> &str {
        &self.0
    }

    #[inline]
    fn permissions() -> Permissions {
        COMMERCIAL_USE | DISTRIBUTION | MODIFICATION | PRIVATE_USE
    }

    #[inline]
    fn conditions() -> Conditions {
        LICENSE_AND_COPYRIGHT_NOTICE
    }

    #[inline]
    fn limitations() -> Limitations {
        NO_LIABILITY | NO_WARRANTY
    }

    #[inline]
    fn homepage() -> Option<&'static str> {
        Some("https://opensource.org/licenses/MIT")
    }
}