From 038ea2afbadb842f17f2920327604f38c84a5772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D1=80=D1=82=D1=91=D0=BC=20=D0=9F=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=20=5BArtyom=20Pavlov=5D?= Date: Wed, 5 Apr 2023 14:51:23 +0300 Subject: [PATCH] tweak failing examples --- hex-literal/README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hex-literal/README.md b/hex-literal/README.md index 827cdd0e..4a97e05c 100644 --- a/hex-literal/README.md +++ b/hex-literal/README.md @@ -47,10 +47,21 @@ assert_eq!(bytes1, bytes2); Using an unsupported character inside literals will result in a compilation error: ```rust,compile_fail -# use hex_literal::hex; -hex!("АА"); // Cyrillic "А" -hex!("11 22"); // Japanese space -hex!("0123 // Сomments inside literals are not supported"); +hex_literal::hex!("АА"); // Cyrillic "А" +hex_literal::hex!("11 22"); // Japanese space +``` + +Сomments inside literals are not supported: +```rust,compile_fail +hex_literal::hex!("0123 // foo"); +``` + +Every literal must contain an even number of hex characters: +```rust,compile_fail +hex_literal::hex!( + "01234" + "567" +); ``` ## Minimum Supported Rust Version