fixup: remove runtime panics from the DTS parser#52
Closed
rmsyn wants to merge 6 commits intomichael2012z:mainfrom
Closed
fixup: remove runtime panics from the DTS parser#52rmsyn wants to merge 6 commits intomichael2012z:mainfrom
rmsyn wants to merge 6 commits intomichael2012z:mainfrom
Conversation
Removes calls to `unwrap` on `Result` and `Option` types to avoid runtime panics. Continues to the next loop iteration on failure conditions. Signed-off-by: rmsyn <rmsynchls@gmail.com>
Removes calls to `unwrap` and explicit `panic`s to avoid runtime panics. Signed-off-by: rmsyn <rmsynchls@gmail.com>
Removes explicit calls to `unwrap`, and changes the return type of `parse_node` to a `Result`. This allows for bubbling up errors, and the future introduction of a library-wide `Error` type. Minor clean-up of some `println` statements. Signed-off-by: rmsyn <rmsynchls@gmail.com>
Removes calls to `unwrap` and explicit `panic`s from `parse_node_value` to avoid runtime panics. Changes the return type to `Result` to make the function fallible, and allow for the future introduction of a library `Error` type. Signed-off-by: rmsyn <rmsynchls@gmail.com>
Removes `unwrap` calls and explicit `panic`s to avoid runtime panics. Changes the return type to `Result` to make `parse_tree` fallible, and allow for the future introduction of a library `Error` type. Signed-off-by: rmsyn <rmsynchls@gmail.com>
Changes the return type to `Result` to make `parse` fallible, and allow for the future introduction of a library `Error` type. Signed-off-by: rmsyn <rmsynchls@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes calls to
unwrapand explicitpanicmacro calls. This helps to avoid runtime panics in the library, and bubbles-up any errors that occur.The top level
DeviceTree::from_dts_bytesis left as an infallible function, and any errors are printed with aprintlncall. Maybe we want to make this fallible as well?These changes are isolated to the DTS parser, and do not fix panics in the DTB parser.