forked from mirrors/jj
templater: forward expect_no_arguments() to expect_exact_arguments()
This commit is contained in:
parent
04efac3a51
commit
da005444e1
1 changed files with 2 additions and 8 deletions
|
@ -683,14 +683,8 @@ pub fn parse<'i>(
|
||||||
|
|
||||||
impl<'i> FunctionCallNode<'i> {
|
impl<'i> FunctionCallNode<'i> {
|
||||||
pub fn expect_no_arguments(&self) -> TemplateParseResult<()> {
|
pub fn expect_no_arguments(&self) -> TemplateParseResult<()> {
|
||||||
if self.args.is_empty() {
|
let [] = self.expect_exact_arguments()?;
|
||||||
Ok(())
|
Ok(())
|
||||||
} else {
|
|
||||||
Err(TemplateParseError::invalid_arguments(
|
|
||||||
self,
|
|
||||||
"Expected 0 arguments",
|
|
||||||
))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Extracts exactly N required arguments.
|
/// Extracts exactly N required arguments.
|
||||||
|
|
Loading…
Reference in a new issue