just/src/keyed.rs
Casey Rodarmor 30c77f8d03
Resolve recipe dependencies (#547)
Make analysis resolve recipe dependencies from names (`Name`) to recipes
(`Rc<Recipe>`), to give type-level certainty that resolution was performed
correctly and remove the need to look up dependencies on run.
2019-11-21 08:23:32 -06:00

12 lines
199 B
Rust

use crate::common::*;
pub(crate) trait Keyed<'key> {
fn key(&self) -> &'key str;
}
impl<'key, T: Keyed<'key>> Keyed<'key> for Rc<T> {
fn key(&self) -> &'key str {
self.as_ref().key()
}
}