Skip to content

Empty or all-blank string should not be an error? #13

@sourcefrog

Description

@sourcefrog

Today you get

> cargo r --example dump /dev/null
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.00s
     Running `target/debug/examples/dump /dev/null`

thread 'main' (394033) panicked at examples/dump.rs:18:51:
called `Result::unwrap()` on an `Err` value: ParseError { line: 1, offset: 0, fragment: "", kind: TakeUntil }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

It seems from

gitpatch/src/ast.rs

Lines 83 to 84 in 5a3b88d

/// Attempt to parse as many patches as possible from the given string. This is useful for when
/// you have a complete diff of many files. String must contain at least one patch.
this is intentional but IMO it's not the best UI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions