Skip to content

Commit 6be62f8

Browse files
authored
Replace \ with std::concat (#4)
We are normalizing the usage of std::concat execlusively for splitting strings into multiple lines. Signed-off-by: Ahmed Abdelraoof <ahmed.abdelraoof@huawei.com>
1 parent ab2913c commit 6be62f8

File tree

1 file changed

+6
-3
lines changed
  • safe-discriminant-derive/src

1 file changed

+6
-3
lines changed

safe-discriminant-derive/src/lib.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use proc_macro::TokenStream;
22
use proc_macro2::Span;
33
use quote::quote;
4+
use std::concat;
45
use syn::{parse_macro_input, spanned::Spanned, Attribute, Error, ItemEnum, Path, Result, Variant};
56

67
const PRIM_VALUES: [&str; 10] = [
@@ -58,9 +59,11 @@ fn valiate_single_variant(v: Variant) -> Option<Error> {
5859
if v.discriminant.is_none() {
5960
Some(Error::new(
6061
v.span(),
61-
"Missing explicit discriminant. Note: If you want to reason about \
62-
discriminants, but do not care about concrete values, consider \
63-
using `core::mem::Discriminant` instead.",
62+
concat!(
63+
"Missing explicit discriminant. Note: If you want to reason about ",
64+
"discriminants, but do not care about concrete values, consider ",
65+
"using `core::mem::Discriminant` instead."
66+
),
6467
))
6568
} else {
6669
None

0 commit comments

Comments
 (0)