-
Notifications
You must be signed in to change notification settings - Fork 106
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
feat(cppgc): add get and unwrap utlities to SameObject
#1059
feat(cppgc): add get and unwrap utlities to SameObject
#1059
Conversation
@@ -182,10 +182,12 @@ impl FunctionTemplateData { | |||
} | |||
} | |||
|
|||
#[derive(Debug)] |
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.
the debug output is probably quite useless; any specific need for it?
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.
The intent is that this would allow #[derive(Debug)]
to be added to DOMQuadInner
, but I don't have a particularly strong opinion.
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.
oh i see, that makes sense!
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1059 +/- ##
==========================================
+ Coverage 81.43% 81.61% +0.17%
==========================================
Files 97 101 +4
Lines 23877 27862 +3985
==========================================
+ Hits 19445 22740 +3295
- Misses 4432 5122 +690 ☔ View full report in Codecov by Sentry. |
@@ -212,4 +214,19 @@ impl<T: GarbageCollected + 'static> SameObject<T> { | |||
}) | |||
.clone() | |||
} | |||
|
|||
pub fn set( |
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.
when is this useful? sameobject should always just be set once and forget, any reason get
cannot be used in your scenario?
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.
Although get
is sufficient, I think it may be useful when we want to assign a value in advance in a constructor or static method.
https://github.com/denoland/deno/blob/dfa4af12b093ac3a504d7fe98004ad7affd1c91a/ext/geometry/lib.rs#L311-L315
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.
makes sense
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
SameObject
utils in cppgcSameObject
These utilities are useful for implementing the Geometry Interface Module Level 1 (denoland/deno#27527).