Remove result_like dependency (#11793)

## Summary

This PR removes the `result-like` dependency and instead implement the
required functionality. The motivation being that `noqa.is_enabled()` is
easier to read than `noqa.into()`.

For context, I was just trying to understand the syntax error workflow
and I saw these flags which were being converted via `into`. I always
find `into` confusing because you never know what's it being converted
into unless you know the type. Later realized that it's just a boolean
flag. After removing the usages from these two flags, it turns out that
the dependency is only being used in one rule so I thought to remove
that as well.

## Test Plan

`cargo insta test`
This commit is contained in:
Dhruv Manilawala 2024-06-07 11:53:22 +05:30 committed by GitHub
parent ea27445479
commit d22f3402e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 60 additions and 57 deletions

View file

@ -299,7 +299,7 @@ pub fn check_path(
}
// Enforce `noqa` directives.
if (noqa.into() && !diagnostics.is_empty())
if (noqa.is_enabled() && !diagnostics.is_empty())
|| settings
.rules
.iter_enabled()
@ -315,7 +315,7 @@ pub fn check_path(
&per_file_ignores,
settings,
);
if noqa.into() {
if noqa.is_enabled() {
for index in ignored.iter().rev() {
diagnostics.swap_remove(*index);
}