diff --git a/forc/src/cli/commands/addr2line.rs b/forc/src/cli/commands/addr2line.rs index b23088985ad..b6288de3cad 100644 --- a/forc/src/cli/commands/addr2line.rs +++ b/forc/src/cli/commands/addr2line.rs @@ -79,7 +79,7 @@ pub(crate) fn exec(command: Command) -> Result<()> { struct ReadRange { source: String, - source_start_byte: usize, + _source_start_byte: usize, source_start_line: usize, offset: usize, length: usize, @@ -117,7 +117,7 @@ fn read_range>( let source = context_buffer.make_contiguous().join(""); let length = range.end - range.start; - let (source_start_line, source_start_byte, offset) = start_pos.ok_or_else(|| { + let (source_start_line, _source_start_byte, offset) = start_pos.ok_or_else(|| { io::Error::new( io::ErrorKind::UnexpectedEof, "Source file was modified, and the mapping is now out of range", @@ -133,7 +133,7 @@ fn read_range>( Ok(ReadRange { source, - source_start_byte, + _source_start_byte, source_start_line, offset, length, diff --git a/forc/src/lib.rs b/forc/src/lib.rs index cd8cda50215..61e0bf2f81a 100644 --- a/forc/src/lib.rs +++ b/forc/src/lib.rs @@ -1,4 +1,3 @@ -#![allow(dead_code)] pub mod cli; mod ops; mod utils; @@ -11,6 +10,5 @@ pub mod test { #[cfg(feature = "util")] pub mod util { - pub use crate::utils::client::start_fuel_core; pub use sway_utils::constants; } diff --git a/forc/src/ops/forc_explorer.rs b/forc/src/ops/forc_explorer.rs index e96b3a2619f..0af45827200 100644 --- a/forc/src/ops/forc_explorer.rs +++ b/forc/src/ops/forc_explorer.rs @@ -12,7 +12,6 @@ type DownloadResult = std::result::Result, name: String, } diff --git a/forc/src/ops/forc_init.rs b/forc/src/ops/forc_init.rs index af3440b49e0..7c034cceec3 100644 --- a/forc/src/ops/forc_init.rs +++ b/forc/src/ops/forc_init.rs @@ -24,6 +24,8 @@ enum FileType { Dir, } +// Dead fields required for deserialization. +#[allow(dead_code)] #[derive(serde::Deserialize, Debug)] struct Links { git: String, @@ -32,6 +34,8 @@ struct Links { cur: String, } +// Dead fields required for deserialization. +#[allow(dead_code)] #[derive(serde::Deserialize, Debug)] struct ContentResponse { #[serde(rename = "_links")] diff --git a/forc/src/utils/client.rs b/forc/src/utils/client.rs deleted file mode 100644 index 6633aaeaacc..00000000000 --- a/forc/src/utils/client.rs +++ /dev/null @@ -1,33 +0,0 @@ -use anyhow::{bail, Result}; -use fuel_gql_client::client::FuelClient; -use std::process::Stdio; -use tokio::process::{Child, Command}; -use tokio::time::{sleep, Duration}; - -pub async fn start_fuel_core(node_url: &str, client: &FuelClient) -> Result { - let mut url_parts = node_url.split(':').collect::>(); - let port = url_parts.pop().unwrap_or("4000"); - let ip = url_parts.join(":"); - - let mut cmd = Command::new("fuel-core"); - cmd.args([format!("--port={}", port), format!("--ip={}", ip)]); - cmd.stderr(Stdio::piped()); - - match cmd.spawn() { - Ok(child) => { - if client.health().await.is_ok() { - return Ok(child); - } - - for _ in 0..5 { - sleep(Duration::from_millis(300)).await; - if client.health().await.is_ok() { - return Ok(child); - } - } - - bail!("Could not start fuel-core") - } - Err(e) => bail!("Failed to spawn: {:?}. Error: {:?}", cmd, e), - } -} diff --git a/forc/src/utils/mod.rs b/forc/src/utils/mod.rs index 97a484c610e..4688d5f8c42 100644 --- a/forc/src/utils/mod.rs +++ b/forc/src/utils/mod.rs @@ -1,4 +1,3 @@ -pub mod client; pub mod defaults; pub mod parameters;