Skip to content

Commit 32d13a2

Browse files
committed
Rename no_std feature to no-std
matches rust-bitcoin
1 parent 0dfcacd commit 32d13a2

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
1.41.0,
1717
# 1.45.2 is MSRV for lightning-net-tokio, lightning-block-sync, and coverage generation
1818
1.45.2,
19-
# 1.47.0 will be the MSRV for no_std builds using hashbrown once core2 is updated
19+
# 1.47.0 will be the MSRV for no-std builds using hashbrown once core2 is updated
2020
1.47.0]
2121
include:
2222
- toolchain: stable
@@ -87,19 +87,19 @@ jobs:
8787
- name: Test on Rust ${{ matrix.toolchain }} with net-tokio and full code-linking for coverage generation
8888
if: matrix.coverage
8989
run: RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always
90-
- name: Test on no_std bullds Rust ${{ matrix.toolchain }}
90+
- name: Test on no-std bullds Rust ${{ matrix.toolchain }}
9191
if: "matrix.build-no-std && !matrix.coverage"
9292
run: |
9393
cd lightning
94-
cargo test --verbose --color always --no-default-features --features no_std
95-
# check if there is a conflict between no_std and the default std feature
96-
cargo test --verbose --color always --features no_std
94+
cargo test --verbose --color always --no-default-features --features no-std
95+
# check if there is a conflict between no-std and the default std feature
96+
cargo test --verbose --color always --features no-std
9797
cd ..
98-
- name: Test on no_std bullds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
98+
- name: Test on no-std builds Rust ${{ matrix.toolchain }} and full code-linking for coverage generation
9999
if: "matrix.build-no-std && matrix.coverage"
100100
run: |
101101
cd lightning
102-
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features no_std
102+
RUSTFLAGS="-C link-dead-code" cargo test --verbose --color always --no-default-features --features no-std
103103
cd ..
104104
- name: Test on Rust ${{ matrix.toolchain }}
105105
if: "! matrix.build-net-tokio"

ci/check-compiles.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cargo check
66
cargo doc
77
cargo doc --document-private-items
88
cd fuzz && cargo check --features=stdin_fuzz
9-
cd ../lightning && cargo check --no-default-features --features=no_std
9+
cd ../lightning && cargo check --no-default-features --features=no-std

lightning/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ max_level_debug = []
2626
unsafe_revoked_tx_signing = []
2727
unstable = []
2828

29-
no_std = ["hashbrown", "bitcoin/no-std", "core2/alloc"]
29+
no-std = ["hashbrown", "bitcoin/no-std", "core2/alloc"]
3030
std = ["bitcoin/std"]
3131

3232
default = ["std"]
3333

3434
[dependencies]
3535
bitcoin = { version = "0.27", default-features = false, features = ["secp-recovery"] }
36-
# TODO maybe bitcoin no-std should pull in this feature?
36+
# TODO remove this once rust-bitcoin PR #637 is released
3737
secp256k1 = { version = "0.20.2", default-features = false, features = ["alloc"] }
3838

3939
hashbrown = { version = "0.11", optional = true }
@@ -45,6 +45,7 @@ core2 = { version = "0.3.0", optional = true, default-features = false }
4545
[dev-dependencies]
4646
hex = "0.3"
4747
regex = "0.1.80"
48+
# TODO remove this once rust-bitcoin PR #637 is released
4849
secp256k1 = { version = "0.20.2", default-features = false, features = ["alloc"] }
4950

5051
[dev-dependencies.bitcoin]

lightning/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
#![cfg_attr(all(any(test, feature = "_test_utils"), feature = "unstable"), feature(test))]
3434
#[cfg(all(any(test, feature = "_test_utils"), feature = "unstable"))] extern crate test;
3535

36-
#[cfg(not(any(feature = "std", feature = "no_std")))]
37-
compile_error!("at least one of the `std` or `no_std` features must be enabled");
36+
#[cfg(not(any(feature = "std", feature = "no-std")))]
37+
compile_error!("at least one of the `std` or `no-std` features must be enabled");
3838

3939
#[macro_use]
4040
extern crate alloc;

lightning/src/routing/router.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3831,19 +3831,19 @@ mod tests {
38313831
}
38323832
}
38333833

3834-
#[cfg(not(feature = "no_std"))]
3834+
#[cfg(not(feature = "no-std"))]
38353835
pub(super) fn random_init_seed() -> u64 {
38363836
// Because the default HashMap in std pulls OS randomness, we can use it as a (bad) RNG.
38373837
use core::hash::{BuildHasher, Hasher};
38383838
let seed = std::collections::hash_map::RandomState::new().build_hasher().finish();
38393839
println!("Using seed of {}", seed);
38403840
seed
38413841
}
3842-
#[cfg(not(feature = "no_std"))]
3842+
#[cfg(not(feature = "no-std"))]
38433843
use util::ser::Readable;
38443844

38453845
#[test]
3846-
#[cfg(not(feature = "no_std"))]
3846+
#[cfg(not(feature = "no-std"))]
38473847
fn generate_routes() {
38483848
let mut d = match super::test_utils::get_route_file() {
38493849
Ok(f) => f,
@@ -3871,7 +3871,7 @@ mod tests {
38713871
}
38723872

38733873
#[test]
3874-
#[cfg(not(feature = "no_std"))]
3874+
#[cfg(not(feature = "no-std"))]
38753875
fn generate_routes_mpp() {
38763876
let mut d = match super::test_utils::get_route_file() {
38773877
Ok(f) => f,
@@ -3899,7 +3899,7 @@ mod tests {
38993899
}
39003900
}
39013901

3902-
#[cfg(all(test, not(feature = "no_std")))]
3902+
#[cfg(all(test, not(feature = "no-std")))]
39033903
pub(crate) mod test_utils {
39043904
use std::fs::File;
39053905
/// Tries to open a network graph file, or panics with a URL to fetch it.
@@ -3926,7 +3926,7 @@ pub(crate) mod test_utils {
39263926
}
39273927
}
39283928

3929-
#[cfg(all(test, feature = "unstable", not(feature = "no_std")))]
3929+
#[cfg(all(test, feature = "unstable", not(feature = "no-std")))]
39303930
mod benches {
39313931
use super::*;
39323932
use util::logger::{Logger, Record};

0 commit comments

Comments
 (0)