Skip to content

Commit

Permalink
Improve documentation for borrowed-box lint
Browse files Browse the repository at this point in the history
  • Loading branch information
1nF0rmed committed Jan 11, 2022
1 parent b66dbe8 commit 7e989ec
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clippy_lints/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,9 @@ declare_clippy_lint! {
/// Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information.
///
/// ### Why is this bad?
/// Any `&Box<T>` can also be a `&T`, which is more
/// general.
/// A `&Box<T>` parameter requires the function caller to box `T` first before passing it to a function.
/// Using `&T` defines a concrete type for the parameter and generalizes the function, this would also
/// auto-deref to `&T` at the function call site if passed a `&Box<T>`.
///
/// ### Example
/// ```rust,ignore
Expand Down

0 comments on commit 7e989ec

Please sign in to comment.