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 2, 2020
1 parent 71a4738 commit 99b7865
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 99b7865

Please sign in to comment.