diff options
| author | Yuri Astrakhan <YuriAstrakhan@gmail.com> | 2024-09-28 13:01:51 -0400 |
|---|---|---|
| committer | Yuri Astrakhan <YuriAstrakhan@gmail.com> | 2024-09-28 13:01:51 -0400 |
| commit | 38295a0d8acf04a55567cbc1bfa3eddd45e5e702 (patch) | |
| tree | 75607f187a06092c3ef2e8a7e606b0369b72e340 | |
| parent | 73a16c10dba19efbd5b3363be5f1d37a60d6436c (diff) | |
| download | rust-38295a0d8acf04a55567cbc1bfa3eddd45e5e702.tar.gz rust-38295a0d8acf04a55567cbc1bfa3eddd45e5e702.zip | |
update docs
| -rw-r--r-- | clippy_lints/src/functions/mod.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clippy_lints/src/functions/mod.rs b/clippy_lints/src/functions/mod.rs index cfa63d3befc..50b3d039ed3 100644 --- a/clippy_lints/src/functions/mod.rs +++ b/clippy_lints/src/functions/mod.rs @@ -410,8 +410,9 @@ declare_clippy_lint! { /// `&Option<T>` in a function signature breaks encapsulation because the caller must own T /// and move it into an Option to call with it. When returned, the owner must internally store /// it as `Option<T>` in order to return it. - /// At a lower level `&Option<T>` points to memory that has `presence` bit flag + value, - /// whereas `Option<&T>` is always optimized to a single pointer. + /// At a lower level, `&Option<T>` points to memory with the `presence` bit flag plus the `T` value, + /// whereas `Option<&T>` is usually [optimized](https://doc.rust-lang.org/1.81.0/std/option/index.html#representation) + /// to a single pointer, so it may be more optimal. /// /// See this [YouTube video](https://www.youtube.com/watch?v=6c7pZYP_iIE) by /// Logan Smith for an in-depth explanation of why this is important. |
