rust/tests
relrelb f0e586c251 Suggest Entry::or_default for Entry::or_insert(Default::default())
Unlike past similar work done in #6228, expand the existing `or_fun_call`
lint to detect `or_insert` calls with a `T::new()` or `T::default()`
argument, much like currently done for `unwrap_or` calls. In that case,
suggest the use of `or_default`, which is more idiomatic.

Note that even with this change, `or_insert_with(T::default)` calls
aren't detected as candidates for `or_default()`, in the same manner
that currently `unwrap_or_else(T::default)` calls aren't detected as
candidates for `unwrap_or_default()`.

Also, as a nearby cleanup, change `KNOW_TYPES` from `static` to `const`,
since as far as I understand it's preferred (should Clippy have a lint
for that?).

Fixes #3812.
2022-09-04 23:43:17 +03:00
..
test_utils Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock 2022-06-16 19:54:42 +04:00
ui Suggest Entry::or_default for Entry::or_insert(Default::default()) 2022-09-04 23:43:17 +03:00
ui-cargo Merge commit '3c7e7dbc15' into clippyup 2022-07-28 19:08:22 +02:00
ui-internal Merge commit '2b2190cb56' into clippyup 2022-08-11 19:42:16 +02:00
ui-toml Initial implementation of result_large_err 2022-08-30 17:39:40 +02:00
workspace_test Merge commit '97a5daa659' into clippyup 2022-01-13 13:18:19 +01:00
check-fmt.rs Fix adjacent code 2022-08-16 18:34:51 -04:00
clippy.toml Merge commit '3ae8faff4d' into clippyup 2021-06-03 08:41:37 +02:00
compile-test.rs Implemented suspicious_to_owned lint to check if to_owned is called on a Cow. 2022-08-26 17:41:17 -07:00
dogfood.rs Fix adjacent code 2022-08-16 18:34:51 -04:00
integration.rs Fix adjacent code 2022-08-16 18:34:51 -04:00
lint_message_convention.rs Fix adjacent code 2022-08-16 18:34:51 -04:00
missing-test-files.rs Merge commit 'e181011378' into clippyup 2021-11-04 12:52:36 +00:00
versioncheck.rs Merge commit '984330a6ee' into clippyup 2022-04-08 10:06:10 +01:00
workspace.rs Fix adjacent code 2022-08-16 18:34:51 -04:00