Skip to content

Commit

Permalink
remove prints and unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
g-k committed Mar 26, 2022
1 parent b0f528d commit ffb2e2b
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/uu/touch/src/touch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
Try 'touch --help' for more information."##,
)
})?;
// println!("got matches: {:?}", matches);
let (mut atime, mut mtime) =
if let Some(reference) = matches.value_of_os(options::sources::REFERENCE) {
stat(Path::new(reference), !matches.is_present(options::NO_DEREF))?
Expand Down Expand Up @@ -294,12 +293,6 @@ fn parse_date(s: &str) -> UResult<FileTime> {
Err(USimpleError::new(1, format!("Unable to parse date: {}", s)))
}

// fn strpformat_to_time_format_description(strpformat: str) -> Option<> {
// match strpformat {
// _ =>
// }
// }

// "%Y%m%d%H%M.%S" 15 chars
const YYYYMMDDHHMM_DOT_SS_FORMAT: &[time::format_description::FormatItem] = format_description!(
"[year repr:full][month repr:numerical padding:zero][day][hour][minute].[second]"
Expand All @@ -321,11 +314,6 @@ fn parse_timestamp(s: &str) -> UResult<FileTime> {
// TODO: handle error
let now = time::OffsetDateTime::now_utc();

// println!("parsing ts {} with {} chars", s, s.chars().count());
// let ps =
// if s.chars().count() == 10 || s.chars().count() == 13 {
// }

let (mut format, mut ts) = match s.chars().count() {
15 => (YYYYMMDDHHMM_DOT_SS_FORMAT, s.to_owned()),
12 => (YYYYMMDDHHMM_FORMAT, s.to_owned()),
Expand All @@ -350,7 +338,6 @@ fn parse_timestamp(s: &str) -> UResult<FileTime> {
format = YYYYMMDDHHMM_DOT_SS_FORMAT;
ts = "20".to_owned() + &ts;
}
// println!("parsing ts {:?} with fmt {:?} err? {:?}", ts, format, time::PrimitiveDateTime::parse(&ts, &format));

let tm = time::PrimitiveDateTime::parse(&ts, &format)
.map_err(|_| USimpleError::new(1, format!("invalid date ts format {}", ts.quote())))?;
Expand Down

0 comments on commit ffb2e2b

Please sign in to comment.