Skip to content

Padding takes KeyOrValue, TEXTBOX_INSETS moves back to Env#1662

Merged
cmyr merged 2 commits intomasterfrom
padding-key-or-value
Mar 29, 2021
Merged

Padding takes KeyOrValue, TEXTBOX_INSETS moves back to Env#1662
cmyr merged 2 commits intomasterfrom
padding-key-or-value

Conversation

@cmyr
Copy link
Member

@cmyr cmyr commented Mar 18, 2021

two related commits; the first enabling the second.

This is more progress on #1652.

child: WidgetPod<T, W>,
}

/// `Insets`, types that impl `Into<Insts>`, or KeyOrValue<Insets>.
Copy link
Collaborator

Choose a reason for hiding this comment

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

typo? Into<Insets>

Also, is there a reason this had to be a trait instead of just impl Into? I haven't been following closely so pls disregard if this is obvious.

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right, I'd been over-thinking this. The problem is that we don't just accept Insets, we also accept things like f64 and (f64, f64), and I was thinking that to make those work we would need to have impl <T: Into<Insets>> Into<KeyOrValue<Insets>> for T, which wouldn't work because of coherence, but we can instead just manually impl Into<KeyOrValue<Insets>> for the various other arguments we want to accept, and that works fine. Thanks!

@cmyr cmyr force-pushed the padding-key-or-value branch from e3fece3 to 4e23805 Compare March 18, 2021 20:16
@cmyr cmyr force-pushed the padding-key-or-value branch from 4e23805 to fbb9ede Compare March 19, 2021 13:28
@cmyr cmyr merged commit fb684ef into master Mar 29, 2021
@cmyr cmyr deleted the padding-key-or-value branch March 29, 2021 19:42
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