Skip to content

Panic unwrapping a float #48

@D1plo1d

Description

@D1plo1d

I got a panic in gcode after sending M28 teg.gcode. Sadly, I haven't been able to reproduce the error so there may be more to it then just parsing an M28 teg.gcode. My question is could we replace this (and any other use) of unwrap with a result?

I'm using this lib in the send gcode to printer loop for https://tegapp.io so a panic here can abort a print whereas a result could be logged safely as a warning on my end (it's non-critical that every gcode gets parsed).

PS. Thanks for making this library - it's been super helpful!

Original Error:

thread 'main' panicked at ': ParseFloatError { kind: Invalid }', /home/d1plo1d/.cargo/registry/src/github.com-1ecc6299db9ec823/gcode-0.5.2/src/words.rs:100:33               
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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