From c333cf5128b6f5135d8f561b217f68e670275031 Mon Sep 17 00:00:00 2001 From: Davirain Date: Sat, 27 Aug 2022 01:47:57 +0800 Subject: [PATCH] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 3a92d19..3f05e86 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ println!("{}", hex_string); // Prints "48656c6c6f20776f726c6421" Decoding a `String` ```rust -let decoded_string = hex::decode("48656c6c6f20776f726c6421"); +let decoded_string = String::from_utf8(hex::decode("48656c6c6f20776f726c6421").unwrap()).unwrap(); println!("{}", decoded_string); // Prints "Hello world!" ```