Update for latest lexicon (#327) #864
Annotations
11 errors
|
Rust (stable)
reviewdog: Too many results (annotations) in diff.
You may miss some annotations due to GitHub limitation for annotation created by logging command.
Please check GitHub Actions log console to see all results.
Limitation:
- 10 warning annotations and 10 error annotations per step
- 50 annotations per job (sum of annotations from all the steps)
- 50 annotations per run (separate from the job annotations, these annotations aren't created by users)
Source: https://github.com/orgs/community/discussions/26680#discussioncomment-3252835
|
|
Rust (stable):
bsky-sdk/src/moderation/mutewords.rs#L115
[clippy] reported by reviewdog 🐶
error: compiling a regex in a loop
--> bsky-sdk/src/moderation/mutewords.rs:115:29
|
115 | .get_or_init(|| Regex::new(r"[\s\n\t\r\f\v]+?").expect("invalid regex"))
| ^^^^^^^^^^
|
help: move the regex construction outside this loop
--> bsky-sdk/src/moderation/mutewords.rs:61:5
|
61 | for mute in muted_words {
| ^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops
Raw Output:
bsky-sdk/src/moderation/mutewords.rs:115:29:e:error: compiling a regex in a loop
--> bsky-sdk/src/moderation/mutewords.rs:115:29
|
115 | .get_or_init(|| Regex::new(r"[\s\n\t\r\f\v]+?").expect("invalid regex"))
| ^^^^^^^^^^
|
help: move the regex construction outside this loop
--> bsky-sdk/src/moderation/mutewords.rs:61:5
|
61 | for mute in muted_words {
| ^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops
__END__
|
|
Rust (stable):
bsky-sdk/src/moderation/mutewords.rs#L106
[clippy] reported by reviewdog 🐶
error: compiling a regex in a loop
--> bsky-sdk/src/moderation/mutewords.rs:106:29
|
106 | .get_or_init(|| Regex::new(r"\s|\p{P}").expect("invalid regex"))
| ^^^^^^^^^^
|
help: move the regex construction outside this loop
--> bsky-sdk/src/moderation/mutewords.rs:61:5
|
61 | for mute in muted_words {
| ^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops
= note: `-D clippy::regex-creation-in-loops` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::regex_creation_in_loops)]`
Raw Output:
bsky-sdk/src/moderation/mutewords.rs:106:29:e:error: compiling a regex in a loop
--> bsky-sdk/src/moderation/mutewords.rs:106:29
|
106 | .get_or_init(|| Regex::new(r"\s|\p{P}").expect("invalid regex"))
| ^^^^^^^^^^
|
help: move the regex construction outside this loop
--> bsky-sdk/src/moderation/mutewords.rs:61:5
|
61 | for mute in muted_words {
| ^^^^^^^^^^^^^^^^^^^^^^^
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#regex_creation_in_loops
= note: `-D clippy::regex-creation-in-loops` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::regex_creation_in_loops)]`
__END__
|
|
Rust (stable):
bsky-sdk/src/moderation/mutewords.rs#L36
[clippy] reported by reviewdog 🐶
error: this `map_or` can be simplified
--> bsky-sdk/src/moderation/mutewords.rs:36:21
|
36 | let exception = langs
| _____________________^
37 | | .as_ref()
38 | | .and_then(|langs| langs.first())
39 | | .map_or(false, |lang| LANGUAGE_EXCEPTIONS.contains(&lang.as_ref().as_str()));
| |____________________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
help: use is_some_and instead
|
39 - .map_or(false, |lang| LANGUAGE_EXCEPTIONS.contains(&lang.as_ref().as_str()));
39 + .is_some_and(|lang| LANGUAGE_EXCEPTIONS.contains(&lang.as_ref().as_str()));
|
Raw Output:
bsky-sdk/src/moderation/mutewords.rs:36:21:e:error: this `map_or` can be simplified
--> bsky-sdk/src/moderation/mutewords.rs:36:21
|
36 | let exception = langs
| _____________________^
37 | | .as_ref()
38 | | .and_then(|langs| langs.first())
39 | | .map_or(false, |lang| LANGUAGE_EXCEPTIONS.contains(&lang.as_ref().as_str()));
| |____________________________________________________________________________________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
help: use is_some_and instead
|
39 - .map_or(false, |lang| LANGUAGE_EXCEPTIONS.contains(&lang.as_ref().as_str()));
39 + .is_some_and(|lang| LANGUAGE_EXCEPTIONS.contains(&lang.as_ref().as_str()));
|
__END__
|
|
Rust (stable):
bsky-sdk/README.md#L181
[clippy] reported by reviewdog 🐶
error: needless `fn main` in doctest
--> bsky-sdk/src/../README.md:181:1
|
181 | / use bsky_sdk::rich_text::RichText;
182 | |
183 | | fn main() {
184 | | let rt = RichText::new("👨👩👧👧", None);
185 | | assert_eq!(rt.text.len(), 25);
186 | | assert_eq!(rt.grapheme_len(), 1);
187 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
= note: `-D clippy::needless-doctest-main` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_doctest_main)]`
Raw Output:
bsky-sdk/src/../README.md:181:1:e:error: needless `fn main` in doctest
--> bsky-sdk/src/../README.md:181:1
|
181 | / use bsky_sdk::rich_text::RichText;
182 | |
183 | | fn main() {
184 | | let rt = RichText::new("👨👩👧👧", None);
185 | | assert_eq!(rt.text.len(), 25);
186 | | assert_eq!(rt.grapheme_len(), 1);
187 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
= note: `-D clippy::needless-doctest-main` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_doctest_main)]`
__END__
|
|
Rust (stable):
atrium-oauth/README.md#L12
[clippy] reported by reviewdog 🐶
error: needless `fn main` in doctest
--> atrium-oauth/src/../README.md:12:1
|
12 | / use atrium_identity::{
13 | | did::{CommonDidResolver, CommonDidResolverConfig, DEFAULT_PLC_DIRECTORY_URL},
14 | | handle::{AtprotoHandleResolver, AtprotoHandleResolverConfig, DnsTxtResolver},
15 | | };
... |
64 | | };
65 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
= note: `-D clippy::needless-doctest-main` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_doctest_main)]`
Raw Output:
atrium-oauth/src/../README.md:12:1:e:error: needless `fn main` in doctest
--> atrium-oauth/src/../README.md:12:1
|
12 | / use atrium_identity::{
13 | | did::{CommonDidResolver, CommonDidResolverConfig, DEFAULT_PLC_DIRECTORY_URL},
14 | | handle::{AtprotoHandleResolver, AtprotoHandleResolverConfig, DnsTxtResolver},
15 | | };
... |
64 | | };
65 | | }
| |_^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_doctest_main
= note: `-D clippy::needless-doctest-main` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_doctest_main)]`
__END__
|
|
Rust (stable):
atrium-repo/src/mst.rs#L973
[clippy] reported by reviewdog 🐶
error: calling `as_bytes` after slicing a string
--> atrium-repo/src/mst.rs:973:29
|
973 | key_suffix: leaf.key[prefix..].as_bytes().to_vec(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&leaf.key.as_bytes()[prefix..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes
= note: `-D clippy::sliced-string-as-bytes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::sliced_string_as_bytes)]`
Raw Output:
atrium-repo/src/mst.rs:973:29:e:error: calling `as_bytes` after slicing a string
--> atrium-repo/src/mst.rs:973:29
|
973 | key_suffix: leaf.key[prefix..].as_bytes().to_vec(),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&leaf.key.as_bytes()[prefix..]`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes
= note: `-D clippy::sliced-string-as-bytes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::sliced_string_as_bytes)]`
__END__
|
|
Rust (stable):
examples/video/src/main.rs#L152
[clippy] reported by reviewdog 🐶
error: this `map_or` can be simplified
--> examples/video/src/main.rs:152:12
|
152 | || limits.remaining_daily_videos.map_or(false, |remain| remain <= 0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
help: use is_some_and instead
|
152 - || limits.remaining_daily_videos.map_or(false, |remain| remain <= 0)
152 + || limits.remaining_daily_videos.is_some_and(|remain| remain <= 0)
|
Raw Output:
examples/video/src/main.rs:152:12:e:error: this `map_or` can be simplified
--> examples/video/src/main.rs:152:12
|
152 | || limits.remaining_daily_videos.map_or(false, |remain| remain <= 0)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
help: use is_some_and instead
|
152 - || limits.remaining_daily_videos.map_or(false, |remain| remain <= 0)
152 + || limits.remaining_daily_videos.is_some_and(|remain| remain <= 0)
|
__END__
|
|
Rust (stable):
examples/video/src/main.rs#L151
[clippy] reported by reviewdog 🐶
error: this `map_or` can be simplified
--> examples/video/src/main.rs:151:12
|
151 | || limits.remaining_daily_bytes.map_or(false, |remain| remain < data.len() as i64)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
help: use is_some_and instead
|
151 - || limits.remaining_daily_bytes.map_or(false, |remain| remain < data.len() as i64)
151 + || limits.remaining_daily_bytes.is_some_and(|remain| remain < data.len() as i64)
|
Raw Output:
examples/video/src/main.rs:151:12:e:error: this `map_or` can be simplified
--> examples/video/src/main.rs:151:12
|
151 | || limits.remaining_daily_bytes.map_or(false, |remain| remain < data.len() as i64)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_map_or
= note: `-D clippy::unnecessary-map-or` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_map_or)]`
help: use is_some_and instead
|
151 - || limits.remaining_daily_bytes.map_or(false, |remain| remain < data.len() as i64)
151 + || limits.remaining_daily_bytes.is_some_and(|remain| remain < data.len() as i64)
|
__END__
|
|
Rust (stable):
bsky-sdk/src/agent.rs#L47
[clippy] reported by reviewdog 🐶
error: empty line after doc comment
--> bsky-sdk/src/agent.rs:43:1
|
43 | / /// ```
44 | |
| |_^
...
47 | pub struct BskyAgent<T = ReqwestClient, S = MemorySessionStore>
| -------------------- the comment documents this struct
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
= help: if the empty line is unintentional, remove it
Raw Output:
bsky-sdk/src/agent.rs:47:1:e:error: empty line after doc comment
--> bsky-sdk/src/agent.rs:43:1
|
43 | / /// ```
44 | |
| |_^
...
47 | pub struct BskyAgent<T = ReqwestClient, S = MemorySessionStore>
| -------------------- the comment documents this struct
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#empty_line_after_doc_comments
= note: `-D clippy::empty-line-after-doc-comments` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::empty_line_after_doc_comments)]`
= help: if the empty line is unintentional, remove it
__END__
|
|
Rust (1.75.0):
bsky-sdk/src/record/agent.rs#L87
[clippy] reported by reviewdog 🐶
error: useless conversion to the same type: `atrium_api::types::string::RecordKey`
--> bsky-sdk/src/record/agent.rs:87:20
|
87 | let rkey = parts[2].parse::<RecordKey>().or(Err(Error::InvalidAtUri))?.into();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `parts[2].parse::<RecordKey>().or(Err(Error::InvalidAtUri))?`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `-D clippy::useless-conversion` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::useless_conversion)]`
Raw Output:
bsky-sdk/src/record/agent.rs:87:20:e:error: useless conversion to the same type: `atrium_api::types::string::RecordKey`
--> bsky-sdk/src/record/agent.rs:87:20
|
87 | let rkey = parts[2].parse::<RecordKey>().or(Err(Error::InvalidAtUri))?.into();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider removing `.into()`: `parts[2].parse::<RecordKey>().or(Err(Error::InvalidAtUri))?`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
= note: `-D clippy::useless-conversion` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::useless_conversion)]`
__END__
|