From 35c6a80e95ca3d29749203c601182f07f80d19a7 Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Wed, 24 Jan 2024 17:04:32 +0100 Subject: Add debug log for mime type validation --- rs/shell/src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'rs/shell/src') diff --git a/rs/shell/src/main.rs b/rs/shell/src/main.rs index b9c50d8..ef0ef48 100644 --- a/rs/shell/src/main.rs +++ b/rs/shell/src/main.rs @@ -1,4 +1,4 @@ -use std::{process::ExitCode, os::unix::process::CommandExt}; +use std::{os::unix::process::CommandExt, process::ExitCode}; fn parse_sq(s: &str) -> Option<(String, &str)> { #[derive(PartialEq, Eq)] @@ -7,13 +7,13 @@ fn parse_sq(s: &str) -> Option<(String, &str)> { Unquoted { may_escape: bool }, UnquotedEscaped, } - + let mut result = String::new(); let mut state = SqState::Unquoted { may_escape: false }; let mut remaining = ""; for (i, c) in s.char_indices() { match state { - SqState::Unquoted { may_escape: false} => { + SqState::Unquoted { may_escape: false } => { if c != '\'' { return None; } @@ -26,7 +26,7 @@ fn parse_sq(s: &str) -> Option<(String, &str)> { } result.push(c); } - SqState::Unquoted { may_escape: true }=> { + SqState::Unquoted { may_escape: true } => { if is_posix_space(c) { remaining = &s[i..]; break; @@ -47,7 +47,7 @@ fn parse_sq(s: &str) -> Option<(String, &str)> { } if state != (SqState::Unquoted { may_escape: true }) { - return None + return None; } Some((result, remaining)) } -- cgit v1.2.3