mirror of
https://github.com/martinvonz/jj.git
synced 2025-05-14 19:54:31 +00:00
templater: forward expect_no_arguments() to expect_exact_arguments()
This commit is contained in:
parent
04efac3a51
commit
da005444e1
@ -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…
x
Reference in New Issue
Block a user