Rename no_std feature to no-std
authorDevrandom <c1.devrandom@niftybox.net>
Tue, 3 Aug 2021 07:38:44 +0000 (09:38 +0200)
committerDevrandom <c1.devrandom@niftybox.net>
Tue, 3 Aug 2021 16:53:33 +0000 (18:53 +0200)
matches rust-bitcoin

.github/workflows/build.yml
ci/check-compiles.sh
lightning/Cargo.toml
lightning/src/lib.rs
lightning/src/routing/router.rs

index 5b886e19bff5d440cdabb8441b4e4a9d17077fdb..f18f3f64d78eda3c96ec61b56f42ea506dc463d2 100644 (file)
@@ -16,7 +16,7 @@ jobs:
                      1.41.0,
                      # 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
                      1.45.2,
-                     # 1.47.0 will be the MSRV for no_std builds using hashbrown once core2 is updated
+                     # 1.47.0 will be the MSRV for no-std builds using hashbrown once core2 is updated
                      1.47.0]
         include:
           - toolchain: stable
@@ -87,19 +87,19 @@ jobs:
       - name: Test on Rust ${{ matrix.toolchain }} with net-tokio and full code-linking for coverage generation
         if: matrix.coverage
         run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
-      - name: Test on no_std bullds Rust ${{ matrix.toolchain }}
+      - name: Test on no-std bullds Rust ${{ matrix.toolchain }}
         if: "matrix.build-no-std && !matrix.coverage"
         run: |
           cd lightning
-          cargo test --verbose --color always --no-default-features --features no_std
-          # check if there is a conflict between no_std and the default std feature
-          cargo test --verbose --color always --features no_std
+          cargo test --verbose --color always --no-default-features --features no-std
+          # check if there is a conflict between no-std and the default std feature
+          cargo test --verbose --color always --features no-std
           cd ..
-      - name: Test on no_std bullds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
+      - name: Test on no-std builds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
         if: "matrix.build-no-std && matrix.coverage"
         run: |
           cd lightning
-          RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features no_std
+          RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features no-std
           cd ..
       - name: Test on Rust ${{ matrix.toolchain }}
         if: "! matrix.build-net-tokio"
index 79c2d92b761ce409cc31fda64d3667bc29bf1cfe..2bc31007b6b7463bfe9df5bd46d4b76bcc36901f 100755 (executable)
@@ -6,4 +6,4 @@ cargo check
 cargo doc
 cargo doc --document-private-items
 cd fuzz && cargo check --features=stdin_fuzz
-cd ../lightning && cargo check --no-default-features --features=no_std
+cd ../lightning && cargo check --no-default-features --features=no-std
index 8bbdfe95a3ebdc138916e435bae85a1f0a3380e7..8580a53a3f88bf87bc698de0fed906a881dfa376 100644 (file)
@@ -26,14 +26,14 @@ max_level_debug = []
 unsafe_revoked_tx_signing = []
 unstable = []
 
-no_std = ["hashbrown", "bitcoin/no-std", "core2/alloc"]
+no-std = ["hashbrown", "bitcoin/no-std", "core2/alloc"]
 std = ["bitcoin/std"]
 
 default = ["std"]
 
 [dependencies]
 bitcoin = { version = "0.27", default-features = false, features = ["secp-recovery"] }
-# TODO maybe bitcoin no-std should pull in this feature?
+# TODO remove this once rust-bitcoin PR #637 is released
 secp256k1 = { version = "0.20.2", default-features = false, features = ["alloc"] }
 
 hashbrown = { version = "0.11", optional = true }
@@ -45,6 +45,7 @@ core2 = { version = "0.3.0", optional = true, default-features = false }
 [dev-dependencies]
 hex = "0.3"
 regex = "0.1.80"
+# TODO remove this once rust-bitcoin PR #637 is released
 secp256k1 = { version = "0.20.2", default-features = false, features = ["alloc"] }
 
 [dev-dependencies.bitcoin]
index e1ae9433e23495c70bb0db99953debf0b4104e8d..e6ecd1f3563c6a312a5e22ffe017a7ea011d7186 100644 (file)
@@ -33,8 +33,8 @@
 #![cfg_attr(all(any(test, feature = "_test_utils"), feature = "unstable"), feature(test))]
 #[cfg(all(any(test, feature = "_test_utils"), feature = "unstable"))] extern crate test;
 
-#[cfg(not(any(feature = "std", feature = "no_std")))]
-compile_error!("at least one of the `std` or `no_std` features must be enabled");
+#[cfg(not(any(feature = "std", feature = "no-std")))]
+compile_error!("at least one of the `std` or `no-std` features must be enabled");
 
 #[macro_use]
 extern crate alloc;
index 1d4234d9db4f0f6154d801d06f90f892d7f21730..13356cc1c74334193fed69be42a05b718d2ab89d 100644 (file)
@@ -3831,7 +3831,7 @@ mod tests {
                }
        }
 
-       #[cfg(not(feature = "no_std"))]
+       #[cfg(not(feature = "no-std"))]
        pub(super) fn random_init_seed() -> u64 {
                // Because the default HashMap in std pulls OS randomness, we can use it as a (bad) RNG.
                use core::hash::{BuildHasher, Hasher};
@@ -3839,11 +3839,11 @@ mod tests {
                println!("Using seed of {}", seed);
                seed
        }
-       #[cfg(not(feature = "no_std"))]
+       #[cfg(not(feature = "no-std"))]
        use util::ser::Readable;
 
        #[test]
-       #[cfg(not(feature = "no_std"))]
+       #[cfg(not(feature = "no-std"))]
        fn generate_routes() {
                let mut d = match super::test_utils::get_route_file() {
                        Ok(f) => f,
@@ -3871,7 +3871,7 @@ mod tests {
        }
 
        #[test]
-       #[cfg(not(feature = "no_std"))]
+       #[cfg(not(feature = "no-std"))]
        fn generate_routes_mpp() {
                let mut d = match super::test_utils::get_route_file() {
                        Ok(f) => f,
@@ -3899,7 +3899,7 @@ mod tests {
        }
 }
 
-#[cfg(all(test, not(feature = "no_std")))]
+#[cfg(all(test, not(feature = "no-std")))]
 pub(crate) mod test_utils {
        use std::fs::File;
        /// Tries to open a network graph file, or panics with a URL to fetch it.
@@ -3926,7 +3926,7 @@ pub(crate) mod test_utils {
        }
 }
 
-#[cfg(all(test, feature = "unstable", not(feature = "no_std")))]
+#[cfg(all(test, feature = "unstable", not(feature = "no-std")))]
 mod benches {
        use super::*;
        use util::logger::{Logger, Record};