Skip to content

Add cast!() macro#282

Merged
skejserjensen merged 5 commits intomainfrom
dev/cast-macro
Feb 4, 2025
Merged

Add cast!() macro#282
skejserjensen merged 5 commits intomainfrom
dev/cast-macro

Conversation

@skejserjensen
Copy link
Copy Markdown
Contributor

PR #275 showed that casts from Any to a concrete type is sometimes needed outside of extracting arrays from Vecs and Recordbatches. Thus, this PR adds the cast!() macro which is defined as $expr.as_any().downcast_ref::<$type>().unwrap() and implements the value!() and array!() macros in terms of it. The PR also replaces all uses of as_any().downcast_ref().unwrap() found by ripgrep with the macro.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants