Skip to content

Commit 53af08a

Browse files
committed
1. Fix uwrap
2. Up version
1 parent 233f242 commit 53af08a

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clucstr"
3-
version = "0.1.3"
3+
version = "0.1.4"
44
authors = ["Денис Котляров <#Ulin Project 18, denis2005991@gmail.com>"]
55
repository = "https://github.com/clucompany/cluCStr.git"
66
license = "Apache-2.0"

src/lib.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,13 @@ pub fn plugin_registrar(reg: &mut Registry) {
186186
pub fn cstr(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) -> Box<MacResult + 'static> {
187187
let mut parser = cx.new_parser_from_tts(args);
188188

189-
let expr = parser.parse_expr().unwrap();
189+
let expr = match parser.parse_expr() {
190+
Ok(a) => a,
191+
Err(_e) => {
192+
cx.span_err(sp, "cstr currently only supports one argument");
193+
return DummyResult::any(sp);
194+
}
195+
};
190196

191197
let c_array = {
192198
let mut add_null = true;

0 commit comments

Comments
 (0)