Skip to content

Commit

Permalink
~ fix placeholder length
Browse files Browse the repository at this point in the history
  • Loading branch information
oluceps committed Nov 10, 2024
1 parent b86c4c0 commit 4f328dd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/helper/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ use nom::{
IResult,
};

// 4 braces and 64 bits hash
const PLACEHOLDER_LENGTH: usize = 70;

fn parse_braced_hash(input: &str) -> IResult<&str, &str, Error<&str>> {
delimited(
tag("{{ "),
Expand All @@ -17,7 +20,7 @@ fn parse_braced_hash(input: &str) -> IResult<&str, &str, Error<&str>> {
}

pub fn extract_all_hashes<'a>(input: &'a str, res: &mut Vec<&'a str>) {
if input.len() < 66 {
if input.len() < PLACEHOLDER_LENGTH {
// less than expected `{{ hash }}` length
return;
}
Expand Down

0 comments on commit 4f328dd

Please sign in to comment.