Skip to content

Commit 4c71e9a

Browse files
committed
lint errors [skip ci]
1 parent c236c6c commit 4c71e9a

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/config/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ pub struct DriaComputeNodeConfig {
3131
/// The default P2P network listen address.
3232
pub(crate) const DEFAULT_P2P_LISTEN_ADDR: &str = "/ip4/0.0.0.0/tcp/4001";
3333

34+
#[allow(clippy::new_without_default)]
3435
impl DriaComputeNodeConfig {
3536
/// Creates new config from environment variables.
3637
pub fn new() -> Self {

src/config/ollama.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl OllamaConfig {
4949
.map(|s| s.to_string())
5050
.collect();
5151

52-
let auto_pull = std::env::var("OLLAMA_AUTO_PULL").unwrap_or_default() == "true".to_string();
52+
let auto_pull = std::env::var("OLLAMA_AUTO_PULL").unwrap_or_default() == "true";
5353

5454
OllamaConfig {
5555
host,
@@ -95,9 +95,10 @@ impl OllamaConfig {
9595
"Downloading missing model {} (this may take a while)",
9696
model
9797
);
98-
let status = ollama.pull_model(model, false).await.map_err(|e| {
99-
format!("Error pulling model with Ollama: {}", e.to_string())
100-
})?;
98+
let status = ollama
99+
.pull_model(model, false)
100+
.await
101+
.map_err(|e| format!("Error pulling model with Ollama: {}", e))?;
101102
log::debug!("Pulled model with Ollama, final status: {:#?}", status);
102103
} else {
103104
// otherwise, give error

src/handlers/workflow.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ impl HandlesWorkflow for DriaComputeNode {
110110
}
111111
}
112112
}
113-
let result =
114-
result.ok_or::<String>(format!("No result for task {}", task.task_id).into())?;
113+
let result = result.ok_or::<String>(format!("No result for task {}", task.task_id))?;
115114

116115
// publish the result
117116
self.send_result(result_topic, &task.public_key, &task.task_id, result)?;

src/p2p/client.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ impl P2PClient {
206206
}
207207
Ok(())
208208
}
209+
209210
/// Returns the list of connected peers within Gossipsub, with a list of subscribed topic hashes by each peer.
210211
pub fn peers(&self) -> Vec<(&PeerId, Vec<&TopicHash>)> {
211212
self.swarm

0 commit comments

Comments
 (0)