verify_terminator

Function verify_terminator 

Source
pub fn verify_terminator(text: &[u8]) -> Result<()>
Expand description

Verifies that the smallest character appears only at the end of the text.

§Arguments

  • text - The text to be verified.

§Errors

An error is returned if the smallest character does not appear only at the end of the text.

§Examples

use small_bwt::verify_terminator;

let text = "abracadabra$";
let result = verify_terminator(text.as_bytes());
assert!(result.is_ok());

let text = "abrac$dabra$";
let result = verify_terminator(text.as_bytes());
assert!(result.is_err());