hyperbuild 0.2.4

Fast allocation-less HTML minifier with smart whitespace handling
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::err::ProcessingResult;
use crate::proc::MatchAction::*;
use crate::proc::MatchMode::*;
use crate::proc::Processor;

pub fn process_comment(proc: &mut Processor) -> ProcessingResult<()> {
    proc.m(IsSeq(b"<!--"), Discard).expect();
    loop {
        // Use fast memchr.
        let possible = proc.m(ThroughChar(b'>'), Discard).require("comment end")?;
        if proc[possible].ends_with(b"-->") {
            break;
        };
    };
    Ok(())
}