aboutsummaryrefslogtreecommitdiff
path: root/src/utils.rs
diff options
context:
space:
mode:
authorMarkus Unterwaditzer <markus-honeypot@unterwaditzer.net>2021-11-27 23:33:26 +0100
committerMarkus Unterwaditzer <markus-honeypot@unterwaditzer.net>2021-11-27 23:43:54 +0100
commit95afc5359e940398498310d46e81352f04b43a49 (patch)
treeb89915478a19f7f8673bb4663e9e7fa112abf09c /src/utils.rs
parent96808d0d940e1580cf86e433d0c844e943157e0d (diff)
fix crash in try_read_string
Diffstat (limited to 'src/utils.rs')
-rw-r--r--src/utils.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils.rs b/src/utils.rs
index 67db1b9..c3d2f1a 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -162,3 +162,11 @@ pub enum ControlToken {
Eof,
Continue,
}
+
+macro_rules! ctostr {
+ ($c:expr) => {
+ &*$c.encode_utf8(&mut [0; 4])
+ };
+}
+
+pub(crate) use ctostr;