feat: atrium-repo
#692
Annotations
10 errors and 2 warnings
Rust (1.75.0):
atrium-repo/src/mst.rs#L918
[clippy] reported by reviewdog 🐶
error: this `else { if .. }` block can be collapsed
--> atrium-repo/src/mst.rs:918:16
|
918 | } else {
| ________________^
919 | | if self.entries.len() != 0 {
920 | | Some(self.entries.len())
921 | | } else {
922 | | None
923 | | }
924 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `-D clippy::collapsible-else-if` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::collapsible_else_if)]`
help: collapse nested if block
|
918 ~ } else if self.entries.len() != 0 {
919 + Some(self.entries.len())
920 + } else {
921 + None
922 + }
|
Raw Output:
atrium-repo/src/mst.rs:918:16:e:error: this `else { if .. }` block can be collapsed
--> atrium-repo/src/mst.rs:918:16
|
918 | } else {
| ________________^
919 | | if self.entries.len() != 0 {
920 | | Some(self.entries.len())
921 | | } else {
922 | | None
923 | | }
924 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#collapsible_else_if
= note: `-D clippy::collapsible-else-if` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::collapsible_else_if)]`
help: collapse nested if block
|
918 ~ } else if self.entries.len() != 0 {
919 + Some(self.entries.len())
920 + } else {
921 + None
922 + }
|
__END__
|
Rust (1.75.0):
atrium-repo/src/blockstore/car.rs#L132
[clippy] reported by reviewdog 🐶
error: this expression creates a reference which is immediately dereferenced by the compiler
--> atrium-repo/src/blockstore/car.rs:132:27
|
132 | storage.write_all(&buf).await?;
| ^^^^ help: change this to: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-D clippy::needless-borrow` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`
Raw Output:
atrium-repo/src/blockstore/car.rs:132:27:e:error: this expression creates a reference which is immediately dereferenced by the compiler
--> atrium-repo/src/blockstore/car.rs:132:27
|
132 | storage.write_all(&buf).await?;
| ^^^^ help: change this to: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
= note: `-D clippy::needless-borrow` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_borrow)]`
__END__
|
Rust (1.75.0):
atrium-repo/src/blockstore/car.rs#L146
[clippy] reported by reviewdog 🐶
error: this expression creates a reference which is immediately dereferenced by the compiler
--> atrium-repo/src/blockstore/car.rs:146:32
|
146 | self.storage.write_all(&buf).await?;
| ^^^^ help: change this to: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Raw Output:
atrium-repo/src/blockstore/car.rs:146:32:e:error: this expression creates a reference which is immediately dereferenced by the compiler
--> atrium-repo/src/blockstore/car.rs:146:32
|
146 | self.storage.write_all(&buf).await?;
| ^^^^ help: change this to: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
__END__
|
Rust (1.75.0):
atrium-repo/src/blockstore/car.rs#L187
[clippy] reported by reviewdog 🐶
error: usage of `contains_key` followed by `insert` on a `HashMap`
--> atrium-repo/src/blockstore/car.rs:187:9
|
187 | / if !self.index.contains_key(&cid) {
188 | | let mut fc = vec![];
189 | | cid.write_bytes(&mut fc).expect("internal error writing CID");
190 | | fc.extend_from_slice(contents);
... |
200 | | self.index.insert(cid, (offs, contents.len()));
201 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
= note: `-D clippy::map-entry` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::map_entry)]`
help: try
|
187 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.index.entry(cid) {
188 + let mut fc = vec![];
189 + cid.write_bytes(&mut fc).expect("internal error writing CID");
190 + fc.extend_from_slice(contents);
191 +
192 + let mut buf = unsigned_varint::encode::u64_buffer();
193 + let buf = unsigned_varint::encode::u64(fc.len() as u64, &mut buf);
194 +
195 + self.storage.write_all(&buf).await?;
196 + let offs = self.storage.stream_position().await?;
197 + self.storage.write_all(&fc).await?;
198 +
199 + // Update the index with the new block.
200 + e.insert((offs, contents.len()));
201 + }
|
Raw Output:
atrium-repo/src/blockstore/car.rs:187:9:e:error: usage of `contains_key` followed by `insert` on a `HashMap`
--> atrium-repo/src/blockstore/car.rs:187:9
|
187 | / if !self.index.contains_key(&cid) {
188 | | let mut fc = vec![];
189 | | cid.write_bytes(&mut fc).expect("internal error writing CID");
190 | | fc.extend_from_slice(contents);
... |
200 | | self.index.insert(cid, (offs, contents.len()));
201 | | }
| |_________^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry
= note: `-D clippy::map-entry` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::map_entry)]`
help: try
|
187 ~ if let std::collections::hash_map::Entry::Vacant(e) = self.index.entry(cid) {
188 + let mut fc = vec![];
189 + cid.write_bytes(&mut fc).expect("internal error writing CID");
190 + fc.extend_from_slice(contents);
191 +
192 + let mut buf = unsigned_varint::encode::u64_buffer();
193 + let buf = unsigned_varint::encode::u64(fc.len() as u64, &mut buf);
194 +
195 + self.storage.write_all(&buf).await?;
196 + let offs = self.storage.stream_position().await?;
197 + self.storage.write_all(&fc).await?;
198 +
199 + // Update the index with the new block.
200 + e.insert((offs, contents.len()));
201 + }
|
__END__
|
Rust (1.75.0):
atrium-repo/src/blockstore/car.rs#L195
[clippy] reported by reviewdog 🐶
error: this expression creates a reference which is immediately dereferenced by the compiler
--> atrium-repo/src/blockstore/car.rs:195:36
|
195 | self.storage.write_all(&buf).await?;
| ^^^^ help: change this to: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
Raw Output:
atrium-repo/src/blockstore/car.rs:195:36:e:error: this expression creates a reference which is immediately dereferenced by the compiler
--> atrium-repo/src/blockstore/car.rs:195:36
|
195 | self.storage.write_all(&buf).await?;
| ^^^^ help: change this to: `buf`
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
__END__
|
Rust (1.75.0):
atrium-repo/src/blockstore/memory.rs#L14
[clippy] reported by reviewdog 🐶
error: you should consider adding a `Default` implementation for `MemoryBlockStore`
--> atrium-repo/src/blockstore/memory.rs:14:5
|
14 | / pub fn new() -> Self {
15 | | Self { blocks: HashMap::new() }
16 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `-D clippy::new-without-default` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::new_without_default)]`
help: try adding this
|
13 + impl Default for MemoryBlockStore {
14 + fn default() -> Self {
15 + Self::new()
16 + }
17 + }
|
Raw Output:
atrium-repo/src/blockstore/memory.rs:14:5:e:error: you should consider adding a `Default` implementation for `MemoryBlockStore`
--> atrium-repo/src/blockstore/memory.rs:14:5
|
14 | / pub fn new() -> Self {
15 | | Self { blocks: HashMap::new() }
16 | | }
| |_____^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#new_without_default
= note: `-D clippy::new-without-default` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::new_without_default)]`
help: try adding this
|
13 + impl Default for MemoryBlockStore {
14 + fn default() -> Self {
15 + Self::new()
16 + }
17 + }
|
__END__
|
Rust (1.75.0):
atrium-repo/src/mst.rs#L129
[clippy] reported by reviewdog 🐶
error: the following explicit lifetimes could be elided: 'a
--> atrium-repo/src/mst.rs:129:26
|
129 | pub fn traverse_find<'a>(
| ^^
130 | key: &'a str,
| ^^
131 | ) -> impl FnMut(Node, Cid) -> Result<TraverseAction<(Node, usize), usize>, Error> + 'a {
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
|
129 ~ pub fn traverse_find(
130 ~ key: &str,
131 ~ ) -> impl FnMut(Node, Cid) -> Result<TraverseAction<(Node, usize), usize>, Error> + '_ {
|
Raw Output:
atrium-repo/src/mst.rs:129:26:e:error: the following explicit lifetimes could be elided: 'a
--> atrium-repo/src/mst.rs:129:26
|
129 | pub fn traverse_find<'a>(
| ^^
130 | key: &'a str,
| ^^
131 | ) -> impl FnMut(Node, Cid) -> Result<TraverseAction<(Node, usize), usize>, Error> + 'a {
| ^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_lifetimes
= note: `-D clippy::needless-lifetimes` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_lifetimes)]`
help: elide the lifetimes
|
129 ~ pub fn traverse_find(
130 ~ key: &str,
131 ~ ) -> impl FnMut(Node, Cid) -> Result<TraverseAction<(Node, usize), usize>, Error> + '_ {
|
__END__
|
Rust (1.75.0):
atrium-repo/src/mst.rs#L143
[clippy] reported by reviewdog 🐶
error: unneeded `return` statement
--> atrium-repo/src/mst.rs:143:25
|
143 | return Ok(TraverseAction::Continue((subtree.clone(), index)));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
143 - return Ok(TraverseAction::Continue((subtree.clone(), index)));
143 + Ok(TraverseAction::Continue((subtree.clone(), index)))
|
Raw Output:
atrium-repo/src/mst.rs:143:25:e:error: unneeded `return` statement
--> atrium-repo/src/mst.rs:143:25
|
143 | return Ok(TraverseAction::Continue((subtree.clone(), index)));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
= note: `-D clippy::needless-return` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::needless_return)]`
help: remove `return`
|
143 - return Ok(TraverseAction::Continue((subtree.clone(), index)));
143 + Ok(TraverseAction::Continue((subtree.clone(), index)))
|
__END__
|
Rust (1.75.0):
atrium-repo/src/mst.rs#L145
[clippy] reported by reviewdog 🐶
error: unneeded `return` statement
--> atrium-repo/src/mst.rs:145:25
|
145 | return Err(Error::KeyNotFound);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
145 - return Err(Error::KeyNotFound);
145 + Err(Error::KeyNotFound)
|
Raw Output:
atrium-repo/src/mst.rs:145:25:e:error: unneeded `return` statement
--> atrium-repo/src/mst.rs:145:25
|
145 | return Err(Error::KeyNotFound);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
help: remove `return`
|
145 - return Err(Error::KeyNotFound);
145 + Err(Error::KeyNotFound)
|
__END__
|
Rust (1.75.0)
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)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|
Rust (1.75.0)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636
|