Skip to content

Commit

Permalink
Remove #![allow(dead_code)] from forc along with dead code (FuelL…
Browse files Browse the repository at this point in the history
…abs#1176)

* Remove `#![allow(dead_code)]` from `forc` along with dead code

This was originally required in order to support the separate implicit
`bin` and `lib` targets for `forc` without getting loads of warnings,
but as of FuelLabs#1174 `cargo` is aware of the separate targets and this is no
longer necessary.

* Remove old feature-gated start_fuel_core re-export
  • Loading branch information
mitchmindtree authored Apr 7, 2022
1 parent 085c7c1 commit 2f4fdcf
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 40 deletions.
6 changes: 3 additions & 3 deletions forc/src/cli/commands/addr2line.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -117,7 +117,7 @@ fn read_range<P: AsRef<Path>>(
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",
Expand All @@ -133,7 +133,7 @@ fn read_range<P: AsRef<Path>>(

Ok(ReadRange {
source,
source_start_byte,
_source_start_byte,
source_start_line,
offset,
length,
Expand Down
2 changes: 0 additions & 2 deletions forc/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#![allow(dead_code)]
pub mod cli;
mod ops;
mod utils;
Expand All @@ -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;
}
1 change: 0 additions & 1 deletion forc/src/ops/forc_explorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ type DownloadResult<T> = std::result::Result<T, Box<dyn std::error::Error + Send

#[derive(Deserialize, Debug)]
struct GitHubRelease {
url: String,
assets: Vec<GitHubReleaseAsset>,
name: String,
}
Expand Down
4 changes: 4 additions & 0 deletions forc/src/ops/forc_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ enum FileType {
Dir,
}

// Dead fields required for deserialization.
#[allow(dead_code)]
#[derive(serde::Deserialize, Debug)]
struct Links {
git: String,
Expand All @@ -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")]
Expand Down
33 changes: 0 additions & 33 deletions forc/src/utils/client.rs

This file was deleted.

1 change: 0 additions & 1 deletion forc/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
pub mod client;
pub mod defaults;
pub mod parameters;

Expand Down

0 comments on commit 2f4fdcf

Please sign in to comment.