Skip to content

Commit

Permalink
chore: Format and apply compiler suggestions.
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Apr 22, 2024
1 parent 0c52123 commit 9e4ce7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub const ANNOUNCE_PARALLELISM: usize = 10;
/// * `namespace_id` - The ID of the replica to announce.
pub async fn announce_replica(namespace_id: NamespaceId) -> Result<(), Box<dyn Error>> {
let mut content = BTreeSet::new();
content.insert(HashAndFormat::raw(Hash::new(namespace_id.clone())));
content.insert(HashAndFormat::raw(Hash::new(namespace_id)));
let dht = mainline::Dht::default();
let announce_stream = announce_dht(dht, content, DISCOVERY_PORT, ANNOUNCE_PARALLELISM);
tokio::pin!(announce_stream);
Expand Down
8 changes: 4 additions & 4 deletions src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl OkuFs {
let node = FsNode::persistent(node_path).await?.spawn().await?;
let authors = node.authors.list().await?;
futures::pin_mut!(authors);
let authors_count = (&authors.as_mut().count().await).to_owned();
let authors_count = authors.as_mut().count().await.to_owned();
let author_id = if authors_count == 0 {
node.authors.create().await?
} else {
Expand Down Expand Up @@ -414,7 +414,7 @@ impl OkuFs {
// Some(node_addrs)
// }
// };
let content = ContentRequest::Hash(Hash::new(namespace_id.clone()));
let content = ContentRequest::Hash(Hash::new(namespace_id));
let secret_key = self.node.magic_endpoint().secret_key();
let endpoint = MagicEndpoint::builder()
.alpns(vec![])
Expand All @@ -429,7 +429,7 @@ impl OkuFs {
content: content.hash_and_format(),
flags: QueryFlags {
complete: !partial,
verified: verified,
verified,
},
};
println!("content corresponds to infohash {}", to_infohash(q.content));
Expand Down Expand Up @@ -503,7 +503,7 @@ pub fn load_or_create_author() -> Result<Author, Box<dyn Error>> {
let mut rng = OsRng;
let author = Author::new(&mut rng);
let author_bytes = author.to_bytes();
std::fs::write(path, &author_bytes)?;
std::fs::write(path, author_bytes)?;
Ok(author)
}
}
Expand Down

0 comments on commit 9e4ce7a

Please sign in to comment.