-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Refactor substr signature #18653
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor substr signature #18653
Conversation
martin-g
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| signature: Signature::one_of( | ||
| vec![ | ||
| TypeSignature::Coercible(vec![string.clone(), int64.clone()]), | ||
| TypeSignature::Coercible(vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
| ], | ||
| Volatility::Immutable, | ||
| ) | ||
| .with_parameter_names(vec![ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be even nice to refactor such blocks in future so param names and types put together like
f.withNames("str", "str_pos").withTpyes("string", "i64")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Raised for tracking: #18685
comphead
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Jefffrey
Which issue does this PR close?
Part of #12725
Rationale for this change
Prefer to avoid user_defined for consistency in function definitions.
What changes are included in this PR?
Refactor signature of substr to use coercion API instead of being user defined.
Are these changes tested?
Existing tests.
Are there any user-facing changes?
No