diff options
Diffstat (limited to '')
-rw-r--r-- | src/tools/clippy/src/docs/borrowed_box.txt | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/tools/clippy/src/docs/borrowed_box.txt b/src/tools/clippy/src/docs/borrowed_box.txt deleted file mode 100644 index d7089be66..000000000 --- a/src/tools/clippy/src/docs/borrowed_box.txt +++ /dev/null @@ -1,19 +0,0 @@ -### What it does -Checks for use of `&Box<T>` anywhere in the code. -Check the [Box documentation](https://doc.rust-lang.org/std/boxed/index.html) for more information. - -### Why is this bad? -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 -``` -fn foo(bar: &Box<T>) { ... } -``` - -Better: - -``` -fn foo(bar: &T) { ... } -```
\ No newline at end of file |