translate Rust unicode representation to C style unicode representation

Signed-off-by: Axel Nennker <axel.nennker@telekom.de>
This commit is contained in:
Axel Nennker
2019-04-15 15:22:56 +02:00
parent 19483c21bc
commit 60b001ebb2
5 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -151,7 +151,7 @@ impl Literal {
syn::Expr::Lit(syn::ExprLit {
lit: syn::Lit::Char(ref value),
..
}) => Ok(Literal::Expr(format!("'{}'", value.value().escape_default()))),
}) => Ok(Literal::Expr(format!("'{}'", value.value().escape_default().to_string().replace('{', "").replace('}', "")))),
syn::Expr::Lit(syn::ExprLit {
lit: syn::Lit::Int(ref value),
..
+1 -1
View File
@@ -7,7 +7,7 @@
#define FOO 10
#define HEART '\u{2764}'
#define HEART '\u2764'
#define NEWLINE '\n'
+1 -1
View File
@@ -7,7 +7,7 @@
#define FOO 10
#define HEART '\u{2764}'
#define HEART '\u2764'
#define NEWLINE '\n'
+1 -1
View File
@@ -6,7 +6,7 @@ static const wchar_t DELIMITER = ':';
static const int32_t FOO = 10;
static const wchar_t HEART = '\u{2764}';
static const wchar_t HEART = '\u2764';
static const wchar_t NEWLINE = '\n';
+1 -1
View File
@@ -7,7 +7,7 @@
#define FOO 10
#define HEART '\u{2764}'
#define HEART '\u2764'
#define NEWLINE '\n'