Skip to content

Commit

Permalink
Rename CoreGraphicsImage::as_ref to CoreGraphicsImage::aas_cgimage so…
Browse files Browse the repository at this point in the history
… as to not conflict with as_ref trait
  • Loading branch information
longmathemagician committed Aug 19, 2022
1 parent f5abbb1 commit 542b7c9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions piet-coregraphics/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl CoreGraphicsImage {
false => CoreGraphicsImage::YUp(image),
}
}
pub fn as_ref(&self) -> Option<&CGImage> {
pub fn as_cgimage(&self) -> Option<&CGImage> {
match self {
CoreGraphicsImage::Empty => None,
CoreGraphicsImage::YUp(image) | CoreGraphicsImage::YDown(image) => Some(image),
Expand Down Expand Up @@ -758,7 +758,7 @@ mod tests {
.capture_image_area(Rect::new(100.0, 100.0, 200.0, 200.0))
.unwrap();

let unwrapped_copy = copy.as_ref().unwrap();
let unwrapped_copy = copy.as_cgimage().unwrap();
let rewrapped_copy = CoreGraphicsImage::from_cgimage_and_ydir(unwrapped_copy.clone(), true);

piet.draw_image(
Expand Down

0 comments on commit 542b7c9

Please sign in to comment.