Conversation
bc00c60 to
8e2a0ca
Compare
8e2a0ca to
ee62996
Compare
alamb
left a comment
There was a problem hiding this comment.
makes sense to me -- thanks @friendlymatthew
scovich
left a comment
There was a problem hiding this comment.
Seems fine, but shouldn't the existing impl Deref (L130 below) transparently provide access to slice.is_empty? (c.f. playground)
I think having an explicit method is probably still helpful even if it is strictly unecessary |
I'm certainly not against it, but I do wonder if there's ever a time where the slice Update: Vec::is_empty exists, so there's definitely precedent. |
|
I suspect this was driven by @friendlymatthew 's experience trying to use Variant in DataFusion I wonder if it was due to autocomplete not proposing |
Rationale for this change
This PR adds
VariantPath::is_emptywhich checks whetherVariantPathcontains an empty list ofVariantPathElements.I found this API to be helpful when validating a
VariantPath, since aVariantPathis only meaningful if it holds a nonempty list ofVariantPathElements