Remove unnecessary public function definitions in sql module

This commit is contained in:
Tobie Morgan Hitchcock 2022-06-26 14:37:11 +01:00
parent 34ba79428c
commit 44f20d3740
3 changed files with 8 additions and 5 deletions

View file

@ -11,6 +11,9 @@ use std::fmt;
use std::ops::Deref; use std::ops::Deref;
use std::str; use std::str;
const SINGLE: char = '\'';
const DOUBLE: char = '"';
#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Deserialize)] #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Deserialize)]
pub struct Datetime(pub DateTime<Utc>); pub struct Datetime(pub DateTime<Utc>);
@ -69,12 +72,12 @@ impl Serialize for Datetime {
pub fn datetime(i: &str) -> IResult<&str, Datetime> { pub fn datetime(i: &str) -> IResult<&str, Datetime> {
alt(( alt((
delimited(char('\"'), datetime_raw, char('\"')), delimited(char(DOUBLE), datetime_raw, char(DOUBLE)),
delimited(char('\''), datetime_raw, char('\'')), delimited(char(SINGLE), datetime_raw, char(SINGLE)),
))(i) ))(i)
} }
pub fn datetime_raw(i: &str) -> IResult<&str, Datetime> { fn datetime_raw(i: &str) -> IResult<&str, Datetime> {
alt((nano, time, date))(i) alt((nano, time, date))(i)
} }

View file

@ -203,7 +203,7 @@ pub fn duration(i: &str) -> IResult<&str, Duration> {
Ok((i, v.iter().sum::<Duration>())) Ok((i, v.iter().sum::<Duration>()))
} }
pub fn duration_raw(i: &str) -> IResult<&str, Duration> { fn duration_raw(i: &str) -> IResult<&str, Duration> {
let (i, v) = part(i)?; let (i, v) = part(i)?;
let (i, u) = unit(i)?; let (i, u) = unit(i)?;
Ok(( Ok((

View file

@ -56,7 +56,7 @@ pub fn script(i: &str) -> IResult<&str, Script> {
Ok((i, Script(String::from(v)))) Ok((i, Script(String::from(v))))
} }
pub fn script_raw(i: &str) -> IResult<&str, &str> { fn script_raw(i: &str) -> IResult<&str, &str> {
recognize(many1(alt((char_any, char_object, string_single, string_double, string_backtick))))(i) recognize(many1(alt((char_any, char_object, string_single, string_double, string_backtick))))(i)
} }