Skip to content

Commit 2a4d5f5

Browse files
author
Decaf Code
committed
fix: fix crontab line trimming
1 parent 0b5f99a commit 2a4d5f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/crontab.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fn read_crontab(file: &str) -> Result<Vec<CronJob>, CronTabError> {
112112
let mut jobs: Vec<CronJob> = Vec::new();
113113

114114
for (line_idx, line) in file.split("\n").enumerate() {
115-
let line = line.trim_start();
115+
let line = line.trim();
116116

117117
if line.is_empty() || line.starts_with("#") {
118118
continue;
@@ -197,7 +197,7 @@ mod tests {
197197
// and added some @alias tests as well.
198198

199199
let jobs = read_crontab(concat!(
200-
" 0 5 0 * * * example_daily\n",
200+
" 0 5 0 * * * example_daily \n",
201201
" # run at 2:15pm on the first of every month\n",
202202
"\n",
203203
" 0 15 14 1 * * example_monthly\n",

0 commit comments

Comments
 (0)