Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow most CGContext methods to be usable from a immutable reference and expose several more methods #250
Conversation
|
Shouldn't these methods be taking a &mut? They are very much mutating the underlying object. |
|
I don't disagree with you. I don't think As a data point, my use case here is: My use case here is: let context: *mut Object = msg_send![class!(NSGraphicsContext), currentContext];
let context: *mut c_void = msg_send![context, CGContext];
let context = CGContextRef::from_ptr(context as *mut _);
context.save();
// [...]
context.restore();Before this PR I was using |
|
Ok. Let's take this. |
|
|
Allow most CGContext methods to be usable from a immutable reference and expose several more methods If this is too much to submit at once, please tell me. This is what I've got left to send in and I'm unsure where to break it up more. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/core-foundation-rs/250) <!-- Reviewable:end -->
|
|
mehcode commentedAug 20, 2018
•
edited by larsbergstrom
If this is too much to submit at once, please tell me. This is what I've got left to send in and I'm unsure where to break it up more.
This change is