use crate::Hir;
use std::ops::Range;
#[derive(Clone, Debug)]
pub struct HirMeta<'a> {
pub range: Range<usize>,
pub filename: &'a str,
pub item: Hir<'a>,
}
impl<'a> HirMeta<'a> {
pub fn new(range: Range<usize>, filename: &'a str, item: Hir<'a>) -> Self {
Self {
range,
filename,
item
}
}
pub fn boxed(range: Range<usize>, filename: &'a str, item: Hir<'a>) -> Box<Self> {
Box::new(HirMeta::new(range, filename, item))
}
pub fn into_box(self) -> Box<Self> {
Box::new(self)
}
}