Skip to content

Commit

Permalink
1. Fix uwrap
Browse files Browse the repository at this point in the history
2. Up version
  • Loading branch information
denisandroid committed Jul 28, 2018
1 parent 233f242 commit 53af08a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clucstr"
version = "0.1.3"
version = "0.1.4"
authors = ["Денис Котляров <#Ulin Project 18, denis2005991@gmail.com>"]
repository = "https://github.com/clucompany/cluCStr.git"
license = "Apache-2.0"
Expand Down
8 changes: 7 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,13 @@ pub fn plugin_registrar(reg: &mut Registry) {
pub fn cstr(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree]) -> Box<MacResult + 'static> {
let mut parser = cx.new_parser_from_tts(args);

let expr = parser.parse_expr().unwrap();
let expr = match parser.parse_expr() {
Ok(a) => a,
Err(_e) => {
cx.span_err(sp, "cstr currently only supports one argument");
return DummyResult::any(sp);
}
};

let c_array = {
let mut add_null = true;
Expand Down

0 comments on commit 53af08a

Please sign in to comment.