Skip to main content

Module notes

Module notes 

Source
Expand description

The checks of the notes of the lead (01M59258K3TYR09HC4AWHWZPEX).

The notes of the lead are text that riff-server keeps for each user and repository. The server and the client use the same checks: check refuses a text over NOTES_MAX bytes (01M59258K3TYR09HC4AWHWZPEX), and a text that looks like a token (01M59258RJ3CG498Z8AVQ5TV5Q).

use riff_core::notes::{NOTES_MAX, check};

assert!(check("Prefer thelio for builds. Commit 3f2a9c1d.").is_ok());
assert!(check(&"a ".repeat(NOTES_MAX)).unwrap_err().contains("64 KiB"));
assert!(check("the token is sk-ant-oat01-abcdefghijklmnop").unwrap_err().contains("secret"));

Constants§

NOTES_MAX
The most bytes of the notes of one lead: 64 KiB.

Functions§

check
Says if text can be the notes of a lead: Err has the reason.