refactor: sanitize AI code
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
// Парсим заголовок на базе Nom
|
||||
pub const HEADER_SIZE: usize = 20;
|
||||
pub const MAX_BODY_SIZE: u64 = 1024 * 1024;
|
||||
|
||||
use nom::{
|
||||
bytes::complete::tag,
|
||||
combinator::verify,
|
||||
@@ -82,6 +85,9 @@ impl Header {
|
||||
pub fn body_size(&self) -> u64 {
|
||||
self.body_size
|
||||
}
|
||||
|
||||
///Валидаторы для данных из заголовка:
|
||||
///
|
||||
// Валидация Header
|
||||
pub fn validate(&self) -> Result<(), HeaderValidationError> {
|
||||
if self.version != 1 {
|
||||
|
||||
Reference in New Issue
Block a user