2022-06-18 21:56:31 -07:00
|
|
|
use super::*;
|
2019-12-07 04:03:03 -08:00
|
|
|
|
2021-06-08 01:01:27 -07:00
|
|
|
#[derive(PartialEq, Debug, Clone)]
|
2019-12-07 04:03:03 -08:00
|
|
|
pub(crate) struct UnresolvedDependency<'src> {
|
2021-09-16 06:44:40 -07:00
|
|
|
pub(crate) recipe: Name<'src>,
|
2019-12-07 04:03:03 -08:00
|
|
|
pub(crate) arguments: Vec<Expression<'src>>,
|
|
|
|
}
|
2021-06-08 01:01:27 -07:00
|
|
|
|
|
|
|
impl<'src> Display for UnresolvedDependency<'src> {
|
|
|
|
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
|
|
|
|
if self.arguments.is_empty() {
|
|
|
|
write!(f, "{}", self.recipe)
|
|
|
|
} else {
|
|
|
|
write!(f, "({}", self.recipe)?;
|
|
|
|
|
|
|
|
for argument in &self.arguments {
|
2022-12-15 16:53:21 -08:00
|
|
|
write!(f, " {argument}")?;
|
2021-06-08 01:01:27 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
write!(f, ")")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|