From 205493c5ab2a8d903d8f3300e4a5e0d3f62a4ab7 Mon Sep 17 00:00:00 2001 From: Boog900 <54e72d8a-345f-4599-bd90-c6b9bc7d0ec5@aleeas.com> Date: Tue, 18 Jun 2024 21:54:21 +0100 Subject: [PATCH] fix errors --- .github/workflows/hack.yml | 5 +++-- helper/src/atomic.rs | 2 +- helper/src/lib.rs | 2 +- net/epee-encoding/src/container_as_blob.rs | 4 +++- net/epee-encoding/src/error.rs | 1 + net/epee-encoding/src/lib.rs | 1 + net/epee-encoding/src/value.rs | 6 +++--- p2p/monero-p2p/Cargo.toml | 2 +- 8 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/hack.yml b/.github/workflows/hack.yml index 1fd4e2934..268a776b9 100644 --- a/.github/workflows/hack.yml +++ b/.github/workflows/hack.yml @@ -27,5 +27,6 @@ jobs: - name: Install dependencies run: cargo install cargo-hack --locked - - name: Deny - run: cargo deny check \ No newline at end of file + - name: Hack Check + # TODO: remove the exclude when `cuprate-blockchain` errors are fixed + run: argo hack --workspace --exclude cuprate-blockchain check --feature-powerset --no-dev-deps \ No newline at end of file diff --git a/helper/src/atomic.rs b/helper/src/atomic.rs index f253737a6..17582c0df 100644 --- a/helper/src/atomic.rs +++ b/helper/src/atomic.rs @@ -6,7 +6,7 @@ use crossbeam::atomic::AtomicCell; #[allow(unused_imports)] // docs -use std::sync::atomic::{Ordering, Ordering::Acquire, Ordering::Release}; +use core::sync::atomic::{Ordering, Ordering::Acquire, Ordering::Release}; //---------------------------------------------------------------------------------------------------- Atomic Float /// Compile-time assertion that our floats are diff --git a/helper/src/lib.rs b/helper/src/lib.rs index 90f420d64..4d942d532 100644 --- a/helper/src/lib.rs +++ b/helper/src/lib.rs @@ -43,7 +43,7 @@ pub mod atomic; #[cfg(feature = "constants")] pub mod constants; -#[cfg(feature = "fs")] +#[cfg(all(feature = "fs", feature = "std"))] pub mod fs; pub mod network; diff --git a/net/epee-encoding/src/container_as_blob.rs b/net/epee-encoding/src/container_as_blob.rs index 084b43bb5..306bb0ab4 100644 --- a/net/epee-encoding/src/container_as_blob.rs +++ b/net/epee-encoding/src/container_as_blob.rs @@ -1,3 +1,5 @@ +use alloc::{string::ToString, vec, vec::Vec}; + use bytes::{Buf, BufMut, Bytes, BytesMut}; use ref_cast::RefCast; use sealed::sealed; @@ -72,7 +74,7 @@ pub trait Containerable { macro_rules! int_container_able { ($int:ty ) => { impl Containerable for $int { - const SIZE: usize = std::mem::size_of::<$int>(); + const SIZE: usize = core::mem::size_of::<$int>(); fn from_bytes(bytes: &[u8]) -> Self { <$int>::from_le_bytes(bytes.try_into().unwrap()) diff --git a/net/epee-encoding/src/error.rs b/net/epee-encoding/src/error.rs index 4b3c7b0d9..d00895844 100644 --- a/net/epee-encoding/src/error.rs +++ b/net/epee-encoding/src/error.rs @@ -1,3 +1,4 @@ +use alloc::string::{String, ToString}; use core::{ fmt::{Debug, Formatter}, num::TryFromIntError, diff --git a/net/epee-encoding/src/lib.rs b/net/epee-encoding/src/lib.rs index ffb0a1ea6..abdd62fa3 100644 --- a/net/epee-encoding/src/lib.rs +++ b/net/epee-encoding/src/lib.rs @@ -61,6 +61,7 @@ extern crate alloc; +use alloc::string::ToString; use core::{ops::Deref, str::from_utf8 as str_from_utf8}; use bytes::{Buf, BufMut, Bytes, BytesMut}; diff --git a/net/epee-encoding/src/value.rs b/net/epee-encoding/src/value.rs index ef42241bc..13f691653 100644 --- a/net/epee-encoding/src/value.rs +++ b/net/epee-encoding/src/value.rs @@ -1,6 +1,6 @@ -use alloc::{string::String, vec::Vec}; -/// This module contains a `sealed` [`EpeeValue`] trait and different impls for -/// the different possible base epee values. +//! This module contains a `sealed` [`EpeeValue`] trait and different impls for +//! the different possible base epee values. +use alloc::{string::String, vec, vec::Vec}; use core::fmt::Debug; use bytes::{Buf, BufMut, Bytes, BytesMut}; diff --git a/p2p/monero-p2p/Cargo.toml b/p2p/monero-p2p/Cargo.toml index 5929c8321..72d216cb1 100644 --- a/p2p/monero-p2p/Cargo.toml +++ b/p2p/monero-p2p/Cargo.toml @@ -14,7 +14,7 @@ cuprate-helper = { path = "../../helper" } monero-wire = { path = "../../net/monero-wire", features = ["tracing"] } monero-pruning = { path = "../../pruning" } -tokio = { workspace = true, features = ["net", "sync", "macros", "time"]} +tokio = { workspace = true, features = ["net", "sync", "macros", "time", "rt"]} tokio-util = { workspace = true, features = ["codec"] } tokio-stream = { workspace = true, features = ["sync"]} futures = { workspace = true, features = ["std"] }