ok/jj
1
0
Fork 0
forked from mirrors/jj

templater: forward expect_no_arguments() to expect_exact_arguments()

This commit is contained in:
Yuya Nishihara 2024-05-21 12:38:10 +09:00
parent 04efac3a51
commit da005444e1

View file

@ -683,14 +683,8 @@ pub fn parse<'i>(
impl<'i> FunctionCallNode<'i> {
pub fn expect_no_arguments(&self) -> TemplateParseResult<()> {
if self.args.is_empty() {
Ok(())
} else {
Err(TemplateParseError::invalid_arguments(
self,
"Expected 0 arguments",
))
}
let [] = self.expect_exact_arguments()?;
Ok(())
}
/// Extracts exactly N required arguments.