From 884ba6de14003aa5b30aea2a8414def6088f661e Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 22 Jun 2021 13:19:31 +0300 Subject: [PATCH 1/2] Fix example in readme --- README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 56e5a80f..05951058 100644 --- a/README.md +++ b/README.md @@ -36,14 +36,14 @@ then run `cargo build`. ```rust extern crate multiaddr; -use multiaddr::{Multiaddr, ToMultiaddr}; +use multiaddr::{Multiaddr, multiaddr}; -let address = "/ip4/127.0.0.1/udp/1234".parse::().unwrap(); -// or directly from a string -let other = "/ip4/127.0.0.1".to_multiaddr().unwrap(); +let address = "/ip4/127.0.0.1/tcp/1234".parse::().unwrap(); +// or with a macros +let other = multiaddr!(Ip4([127, 0, 0, 1]), Udp(10500u16), Quic); -assert_eq!(address.to_string(), "/ip4/127.0.0.1/udp/1234"); -assert_eq!(other.to_string(), "/ip4/127.0.0.1"); +assert_eq!(address.to_string(), "/ip4/127.0.0.1/tcp/1234"); +assert_eq!(other.to_string(), "/ip4/127.0.0.1/udp/10500/quic"); ``` ## Maintainers From 3e54dd20e739be47dbd6f74333a0453900fbece0 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 22 Jun 2021 14:51:41 +0300 Subject: [PATCH 2/2] Update README.md Co-authored-by: Max Inden --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05951058..5f363dd7 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ extern crate multiaddr; use multiaddr::{Multiaddr, multiaddr}; let address = "/ip4/127.0.0.1/tcp/1234".parse::().unwrap(); -// or with a macros +// or with a macro let other = multiaddr!(Ip4([127, 0, 0, 1]), Udp(10500u16), Quic); assert_eq!(address.to_string(), "/ip4/127.0.0.1/tcp/1234");