Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit 0927be1

Browse files
committed
chore(ipfs): clippies
assorted unused or idiomatic changes.
1 parent e9355bd commit 0927be1

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

src/ipld/dag_json.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ where
5151
Ipld::String(string) => ser.serialize_str(string),
5252
Ipld::Bytes(bytes) => ser.serialize_bytes(bytes),
5353
Ipld::List(list) => {
54-
let wrapped = list.iter().map(|ipld| Wrapper(ipld));
54+
let wrapped = list.iter().map(Wrapper);
5555
ser.collect_seq(wrapped)
5656
}
5757
Ipld::Map(map) => {

src/ipns/dnslink.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub async fn resolve(domain: &str) -> Result<IpfsPath, Error> {
3333
// previous implementation searched $domain and _dnslink.$domain concurrently. not sure did
3434
// `domain` assume fqdn names or not, but local suffices were not being searched on windows at
3535
// least. they are probably waste of time most of the time.
36-
for domain in searched.into_iter() {
36+
for domain in searched {
3737
let res = match resolver.txt_lookup(&*domain).await {
3838
Ok(res) => res,
3939
Err(e) => {
@@ -55,7 +55,7 @@ pub async fn resolve(domain: &str) -> Result<IpfsPath, Error> {
5555
.map(|suffix| {
5656
std::str::from_utf8(suffix)
5757
.map_err(Error::from)
58-
.and_then(|s| IpfsPath::from_str(s))
58+
.and_then(IpfsPath::from_str)
5959
});
6060

6161
if let Some(Ok(x)) = paths.next() {

src/repo/fs.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::error::Error;
66
use async_trait::async_trait;
77
use std::fs::File;
88
use std::path::PathBuf;
9-
use std::sync::{atomic::AtomicU64, Arc};
9+
use std::sync::Arc;
1010
use tokio::sync::Semaphore;
1111

1212
use super::{BlockRm, BlockRmError, Column, DataStore, Lock, LockError, RepoCid};
@@ -41,9 +41,6 @@ pub struct FsDataStore {
4141
/// collection implementation, it might be needed to hold this permit for the duration of
4242
/// garbage collection, or something similar.
4343
lock: Arc<Semaphore>,
44-
45-
/// Not really needed
46-
written_bytes: AtomicU64,
4744
}
4845

4946
/// The column operations are all unimplemented pending at least downscoping of the
@@ -55,7 +52,6 @@ impl DataStore for FsDataStore {
5552
FsDataStore {
5653
path: root,
5754
lock: Arc::new(Semaphore::new(1)),
58-
written_bytes: Default::default(),
5955
}
6056
}
6157

0 commit comments

Comments
 (0)