From 73a44fb46cd98d0db101572be6a8e246d395c0b6 Mon Sep 17 00:00:00 2001 From: longmathemagician Date: Thu, 18 Aug 2022 23:13:48 -0700 Subject: [PATCH] Rename CoreGraphicsImage::as_ref to CoreGraphicsImage::as_cgimage so as to not conflict with as_ref trait Edit: Fix typo in commit message --- piet-coregraphics/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/piet-coregraphics/src/lib.rs b/piet-coregraphics/src/lib.rs index 4304860b..dbae7aeb 100644 --- a/piet-coregraphics/src/lib.rs +++ b/piet-coregraphics/src/lib.rs @@ -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), @@ -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(