Skip to content

feat: implement schemars for smallvec - #813

Merged
alejandro-vaz merged 2 commits into
servo:v2from
GauravPawar101:schemars
Oct 28, 2026
Merged

alejandro-vaz merged 2 commits into
servo:v2from
GauravPawar101:schemars

Conversation

@GauravPawar101

Copy link
Copy Markdown
Collaborator

Closes #799

Comment thread src/lib.rs
for SmallVec<Item, INLINE, Heap>
{
fn inline_schema() -> bool {
<alloc::vec::Vec<Item> as JsonSchema>::inline_schema()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't like it but I don't think we have any alternative

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll think about it

@alejandro-vaz

Copy link
Copy Markdown
Collaborator

btw what's your email address?? so we can communicate over there as well??

send me an email better instead

@alejandro-vaz

Copy link
Copy Markdown
Collaborator

miri and tests fail

Signed-off-by: Gauravpawar101 <Gauravpawar2522@gmail.com>
Signed-off-by: Gauravpawar101 <Gauravpawar2522@gmail.com>
Comment thread tests/macro.rs
@GauravPawar101

Copy link
Copy Markdown
Collaborator Author

No, it’s that the element type of vec![] in the empty case is unknown. With serde_json in the build, i32 has several PartialEq impls, so rustc can’t choose one. &*vec == &*vec![] still needs T: PartialEq<?U>, so it fails the same way. .as_ref() would add more inference ambiguity, since there are several AsRef impls.

@alejandro-vaz alejandro-vaz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

👍, it doesn't matter much

@alejandro-vaz
alejandro-vaz added this pull request to the merge queue Oct 28, 2026
Merged via the queue into servo:v2 with commit f2434e7 Oct 28, 2026
8 checks passed
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.

implement schemars crate for smallvec

2 participants