-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[Merged by Bors] - Implemented Reflect
for all the ranges
#5806
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -18,7 +18,7 @@ use std::{ | |||||||||||||||||||||
NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128, | ||||||||||||||||||||||
NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, | ||||||||||||||||||||||
}, | ||||||||||||||||||||||
ops::Range, | ||||||||||||||||||||||
ops::{Range, RangeFrom, RangeFull, RangeInclusive, RangeTo, RangeToInclusive}, | ||||||||||||||||||||||
}; | ||||||||||||||||||||||
|
||||||||||||||||||||||
impl_reflect_value!(bool(Debug, Hash, PartialEq, Serialize, Deserialize)); | ||||||||||||||||||||||
|
@@ -41,6 +41,11 @@ impl_reflect_value!(String(Debug, Hash, PartialEq, Serialize, Deserialize)); | |||||||||||||||||||||
impl_reflect_value!(Result<T: Clone + Reflect + 'static, E: Clone + Reflect + 'static>()); | ||||||||||||||||||||||
impl_reflect_value!(HashSet<T: Hash + Eq + Clone + Send + Sync + 'static>()); | ||||||||||||||||||||||
impl_reflect_value!(Range<T: Clone + Send + Sync + 'static>()); | ||||||||||||||||||||||
impl_reflect_value!(RangeInclusive<T: Clone + Send + Sync + 'static>()); | ||||||||||||||||||||||
impl_reflect_value!(RangeFrom<T: Clone + Send + Sync + 'static>()); | ||||||||||||||||||||||
impl_reflect_value!(RangeTo<T: Clone + Send + Sync + 'static>()); | ||||||||||||||||||||||
impl_reflect_value!(RangeToInclusive<T: Clone + Send + Sync + 'static>()); | ||||||||||||||||||||||
Comment on lines
43
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: You have an extra space before each
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd make these changes myself, but I've been disallowed from pushing to this branch :) |
||||||||||||||||||||||
impl_reflect_value!(RangeFull()); | ||||||||||||||||||||||
impl_reflect_value!(Duration(Debug, Hash, PartialEq, Serialize, Deserialize)); | ||||||||||||||||||||||
impl_reflect_value!(Instant(Debug, Hash, PartialEq)); | ||||||||||||||||||||||
impl_reflect_value!(NonZeroI128(Debug, Hash, PartialEq, Serialize, Deserialize)); | ||||||||||||||||||||||
|
@@ -75,6 +80,11 @@ impl_from_reflect_value!(f64); | |||||||||||||||||||||
impl_from_reflect_value!(String); | ||||||||||||||||||||||
impl_from_reflect_value!(HashSet<T: Hash + Eq + Clone + Send + Sync + 'static>); | ||||||||||||||||||||||
impl_from_reflect_value!(Range<T: Clone + Send + Sync + 'static>); | ||||||||||||||||||||||
impl_from_reflect_value!(RangeInclusive<T: Clone + Send + Sync + 'static>); | ||||||||||||||||||||||
impl_from_reflect_value!(RangeFrom<T: Clone + Send + Sync + 'static>); | ||||||||||||||||||||||
impl_from_reflect_value!(RangeTo<T: Clone + Send + Sync + 'static>); | ||||||||||||||||||||||
impl_from_reflect_value!(RangeToInclusive<T: Clone + Send + Sync + 'static>); | ||||||||||||||||||||||
impl_from_reflect_value!(RangeFull); | ||||||||||||||||||||||
impl_from_reflect_value!(Duration); | ||||||||||||||||||||||
impl_from_reflect_value!(Instant); | ||||||||||||||||||||||
impl_from_reflect_value!(NonZeroI128); | ||||||||||||||||||||||
|
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.
Nit: Not that you have to, since none of the others do this, but you could replace some of those bounds with
Reflect
itself:Feel free to resolve this if you'd rather keep it as is haha
Edit: I guess this suggestion would require that the inner type is reflectable as well, which might be a good reason to hold off on applying it.