Skip to content

Schedule: Fix duration parser to detect trailing numbers #30

Description

@PedramNavid

Problem

The duration parser silently ignores trailing numbers without units.

Location: src/core/schedule.rs:127-154

Input like "5m30" would parse as 5 minutes, silently ignoring the trailing 30.

Recommendation

Check if current_num is non-empty after the loop:

if !current_num.is_empty() {
    return Err(ScheduleError::InvalidInterval(format!(
        "number without unit: {}",
        s
    )));
}

Priority

Priority Fix - Silent parsing errors lead to unexpected behavior.


Created from PR review: #28 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions