Handle case when rust macro node has no children of type identifier
Prelude
Thank you for helping out vim-doge!
By contributing to vim-doge you agree to the following statements:
- [x] I have read and understood the Contribution Guidelines.
- [x] I have read and understood the Code of Conduct.
Why this PR?
To do an unhandled unwrap expression in the rust parser, vim-doge would crash if a macro within a function had no children with the type of identifier (from my understanding of the code). A minimal reproducible example of this would be with the log crate:
fn testing() {
log::info!("this will crash");
}
Note that this doesn't even have to be within a Rust project as it will crash either way. I fixed this bug by just saying that the item doesn't panic if it has no children which are identifiers, which I believe was the intended behavior.
If you'd like me to remove the other changes that rustfmt automatically did when I saved the file, I can do that, but it did make it more consistent as there we're a few spots with 2-space indentation while the rest of the file was 4-space.
Thanks so much!
@TabulateJarl8 please rebase from master again, because I had to update the workflow files to make the automated tests work again :)
@kkoomen should be done now. Not sure if it wants you to re-approve or if the CI just takes a minute to spin up, but seems like it wants approval on my end