Files
rust/tests/ui
dswij 4e5d00a0a7 Deprecate redundant lint option_map_or_err_ok and take manual_ok_or out of pedantic (#14027)
While extending the `option_map_or_err_ok` lint (warn by default,
"style") to recognize η-expanded forms of `Ok`, as in

```rust
    // Should suggest `opt.ok_or("foobar")`
   let _ = opt.map_or(Err("foobar"), |x| Ok(x));
```

I discovered that the `manual_ok_or` lint (allow by default, "pedantic")
already covered exactly the cases handled by `option_map_or_err_ok`,
including the one I was adding. Apparently, `option_map_or_err_ok` was
added without realizing that the lint already existed under the
`manual_ok_or` name. As a matter of fact, artifacts of this second lint
were even present in the first lint `stderr` file and went unnoticed for
more than a year.

This PR:
- deprecates `option_map_or_err_ok` with a message saying to use
`manual_ok_or`
- moves `manual_ok_or` from "pedantic" to "style" (the category in which
`option_map_or_err_ok` was)

In addition, I think that this lint, which is short, machine applicable,
and leads to shorter and clearer code with less arguments (`Ok`
disappears) and the removal of one level of call (`Err(x)` is replaced
by `x`), is a reason by itself to be in "style".

changelog: [`option_map_or_err_ok` and `manual_ok_or`]: move
`manual_ok_or` from "pedantic" to "style", and deprecate the redundant
style lint `option_map_or_err_ok`.
2025-02-07 17:34:21 +00:00
..
2025-01-08 07:34:59 +00:00
2024-12-13 00:04:56 +00:00
2025-01-07 16:04:14 +01:00
2025-01-07 16:04:14 +01:00
2024-10-08 10:58:49 -04:00
2024-10-08 10:58:49 -04:00
2025-02-02 04:22:19 +09:00
2025-02-02 04:22:19 +09:00
2025-02-02 04:22:19 +09:00
2024-05-08 21:37:55 +02:00
2024-05-08 21:37:55 +02:00
2024-05-08 21:37:55 +02:00
2024-04-27 10:54:35 +03:00
2024-07-04 22:31:53 +02:00
2024-07-04 21:27:52 +02:00
2024-07-04 22:31:53 +02:00
2024-10-05 00:19:43 +00:00
2024-10-05 00:19:43 +00:00
2024-10-05 00:19:43 +00:00
2024-12-13 00:04:56 +00:00
2024-04-27 10:54:35 +03:00
2024-12-12 23:36:27 +00:00
2024-04-24 13:12:33 +01:00
2024-06-13 12:24:31 +02:00
2024-06-13 12:24:31 +02:00
2024-04-24 13:12:33 +01:00
2024-12-12 23:36:27 +00:00
2024-12-13 00:04:56 +00:00
2024-06-09 07:47:42 +01:00