Skip to content

Commit

Permalink
Add a comment why Ref lens is necessary for arrays.
Browse files Browse the repository at this point in the history
  • Loading branch information
luleyleo committed Sep 3, 2020
1 parent a7663f8 commit ad41dfd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions druid/src/lens/lens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ pub trait LensExt<A: ?Sized, B: ?Sized>: Lens<A, B> {
/// Invoke a type's `AsRef` and `AsMut` impl.
///
/// It also allows indexing arrays with the [`index`] lens as shown in the example.
/// This is necessary, because the `Index` trait in Rust is only implemented
/// for slices (`[T]`), but not for arrays (`[T; N]`).
///
/// # Examples
///
Expand Down

0 comments on commit ad41dfd

Please sign in to comment.