Remove side-effect from assertion; add release build to travis

This commit is contained in:
Andrew Poelstra 2015-11-18 18:22:16 -06:00
parent d35168d626
commit 9a91b69fad
3 changed files with 7 additions and 4 deletions

View File

@ -15,7 +15,9 @@ install:
script: script:
- | - |
travis-cargo build && travis-cargo build &&
travis-cargo build --release &&
travis-cargo test && travis-cargo test &&
travis-cargo test --release &&
travis-cargo bench && travis-cargo bench &&
travis-cargo --only stable doc travis-cargo --only stable doc

View File

@ -1,7 +1,7 @@
[package] [package]
name = "secp256k1" name = "secp256k1"
version = "0.5.0" version = "0.5.1"
authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>", authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>",
"Andrew Poelstra <apoelstra@wpsoftware.net>" ] "Andrew Poelstra <apoelstra@wpsoftware.net>" ]
license = "CC0-1.0" license = "CC0-1.0"

View File

@ -161,9 +161,10 @@ impl PublicKey {
unsafe { unsafe {
let mut ret_len = ret.len() as ::libc::size_t; let mut ret_len = ret.len() as ::libc::size_t;
let compressed = if compressed { ffi::SECP256K1_SER_COMPRESSED } else { ffi::SECP256K1_SER_UNCOMPRESSED }; let compressed = if compressed { ffi::SECP256K1_SER_COMPRESSED } else { ffi::SECP256K1_SER_UNCOMPRESSED };
debug_assert!(ffi::secp256k1_ec_pubkey_serialize(secp.ctx, ret.as_ptr(), let err = ffi::secp256k1_ec_pubkey_serialize(secp.ctx, ret.as_ptr(),
&mut ret_len, self.as_ptr(), &mut ret_len, self.as_ptr(),
compressed) == 1); compressed);
debug_assert_eq!(err, 1);
ret.set_len(ret_len as usize); ret.set_len(ret_len as usize);
} }
ret ret