pub mod decl {
pub trait Empty<T> {
const EMPTY: T;
}
pub trait Idx<T, O>
{
fn index(&self, idx: T) -> O;
fn get(&self, idx: T) -> O
{
self.index(idx)
}
}
}
pub mod imple {
use super::decl::*;
impl Empty<&str> for &str {
const EMPTY: &'static str = "";
}
impl Empty<String> for String {
const EMPTY: String = String::new();
}
impl<T> Empty<Option<T>> for Option<T>
{
const EMPTY: Option<T> = None;
}
}