Skip to content

Commit

Permalink
Rename from_layer to from_ca_layer to match naming scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 9, 2024
1 parent cbc2147 commit ab48083
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ impl Layer {
/// let layer = unsafe { CAMetalLayer::new() };
/// let ptr: NonNull<CAMetalLayer> = NonNull::from(&*layer);
///
/// let layer = unsafe { Layer::from_layer(ptr.cast()) };
/// let layer = unsafe { Layer::from_ca_layer(ptr.cast()) };
/// assert!(layer.pre_existing());
/// ```
///
Expand All @@ -261,10 +261,10 @@ impl Layer {
/// let layer = CALayer::new();
/// let ptr: NonNull<CALayer> = NonNull::from(&*layer);
///
/// let layer = unsafe { Layer::from_layer(ptr.cast()) };
/// let layer = unsafe { Layer::from_ca_layer(ptr.cast()) };
/// assert!(!layer.pre_existing());
/// ```
pub unsafe fn from_layer(layer_ptr: NonNull<c_void>) -> Self {
pub unsafe fn from_ca_layer(layer_ptr: NonNull<c_void>) -> Self {
// SAFETY: Caller ensures that the pointer is a valid `CALayer`.
let root_layer: &CALayer = unsafe { layer_ptr.cast().as_ref() };

Expand Down

0 comments on commit ab48083

Please sign in to comment.