Skip to content

Commit

Permalink
Replace \ with std::concat (#4)
Browse files Browse the repository at this point in the history
We are normalizing the usage of std::concat execlusively for splitting strings into multiple lines.

Signed-off-by: Ahmed Abdelraoof <ahmed.abdelraoof@huawei.com>
  • Loading branch information
oddcoder authored Aug 19, 2024
1 parent ab2913c commit 6be62f8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions safe-discriminant-derive/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use proc_macro::TokenStream;
use proc_macro2::Span;
use quote::quote;
use std::concat;
use syn::{parse_macro_input, spanned::Spanned, Attribute, Error, ItemEnum, Path, Result, Variant};

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

0 comments on commit 6be62f8

Please sign in to comment.