Skip to content

Commit e30c6d0

Browse files
committed
fix cli test
1 parent 9266631 commit e30c6d0

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

lightning/src/ln/msgs.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use core::convert::TryInto;
4040
use core::fmt;
4141
use core::fmt::Debug;
4242
use core::str::FromStr;
43-
use std::net::{AddrParseError, Ipv4Addr, Ipv6Addr, SocketAddr};
4443
use crate::io::{self, Read};
4544
use crate::io_extras::read_to_end;
4645

@@ -651,19 +650,20 @@ impl Readable for NetAddress {
651650
}
652651
}
653652

653+
#[cfg(feature = "std")]
654654
impl FromStr for NetAddress {
655-
type Err = AddrParseError;
655+
type Err = std::net::AddrParseError;
656656

657657
fn from_str(s: &str) -> Result<Self, Self::Err> {
658-
match SocketAddr::from_str(s) {
658+
match std::net::SocketAddr::from_str(s) {
659659
Ok(addr) => {
660660
let port: u16 = addr.port();
661661
match addr {
662-
SocketAddr::V4(addr) => {
662+
std::net::SocketAddr::V4(addr) => {
663663
let addr = addr.ip().octets();
664664
return Ok(NetAddress::IPv4 { addr, port });
665665
},
666-
SocketAddr::V6(addr) => {
666+
std::net::SocketAddr::V6(addr) => {
667667
let addr = addr.ip().octets();
668668
return Ok(NetAddress::IPv6 { addr, port });
669669
},
@@ -2100,7 +2100,7 @@ impl_writeable_msg!(GossipTimestampFilter, {
21002100
timestamp_range,
21012101
}, {});
21022102

2103-
#[cfg(test)]
2103+
#[cfg(all(test, not(feature = "no-std")))]
21042104
mod tests {
21052105
use hex;
21062106
use crate::ln::{PaymentPreimage, PaymentHash, PaymentSecret};

lightning/src/util/base32.rs

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
// SOFTWARE.
2121
// (reference https://github.com/andreasots/base32/blob/master/LICENSE-MIT)
2222

23+
use crate::prelude::*;
24+
2325
/// Alphabet used for encoding and decoding.
2426
#[derive(Copy, Clone)]
2527
pub enum Alphabet {

0 commit comments

Comments
 (0)