Skip to content

Add support for closure as argument to default - #380

Merged
TedDriggs merged 3 commits into
TedDriggs:masterfrom
cyqsimon:default-closure
Sep 24, 2025
Merged

TedDriggs merged 3 commits into
TedDriggs:masterfrom
cyqsimon:default-closure

Conversation

@cyqsimon

Copy link
Copy Markdown
Contributor

Comment thread core/src/options/mod.rs
Comment thread src/lib.rs
@cyqsimon

Copy link
Copy Markdown
Contributor Author

Seems like I forgot to attach span info somewhere...

@TedDriggs TedDriggs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is directionally excellent - requested changes are small.

Please rebase before next push, as I've fixed an issue upstream with how Callable handles literals.

Comment thread tests/defaults.rs
Comment thread tests/defaults.rs Outdated
Comment thread core/src/options/mod.rs Outdated
@cyqsimon

Copy link
Copy Markdown
Contributor Author

I did an interactive rebase to keep the history clean. Hope you find this okay.

Will work on those compile tests next.

Tested cases:
- Callable has wrong return type
- Callable's return type is the pre-mapped type
- Field is multi-occurence but callable's return type isn't
- Callable has extraneous parameters (expecting 0)
- Quoted closure is incorrectly allowed

All cases (excepted for quoted closure) test all three accepted forms
(path expr, path literal, closure expr)
@TedDriggs
TedDriggs merged commit 3b0cbb7 into TedDriggs:master Sep 24, 2025
12 checks passed
@cyqsimon
cyqsimon deleted the default-closure branch September 25, 2025 02:46
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.

2 participants