use crate::base_types::{
TgqeLine, TgqeLinesIter,
};
impl TgqeLine {
pub fn new(
filepath: &str,
line: i16,
code: String,
) -> Self {
Self {
filepath: filepath.to_string(),
line,
code,
}
}
}
impl Default for TgqeLine {
fn default() -> Self {
Self::new(
"[TGQE] Unknown",
-1,
"[TGQE] Unknown".to_string(),
)
}
}
impl TgqeLinesIter {
pub(crate) fn new(
lines: Vec<TgqeLine>,
) -> Self {
Self {
inner: lines.into_iter(),
}
}
}
impl Iterator for TgqeLinesIter {
type Item = TgqeLine;
fn next(
&mut self,
) -> Option<Self::Item> {
self.inner.next()
}
fn size_hint(
&self,
) -> (usize, Option<usize>) {
self.inner.size_hint()
}
}
impl ExactSizeIterator for TgqeLinesIter {}