Merge pull request #138 from dongcarl/2018-8-usize-fix

Fix compilation warning when comparing usize and u64 on 32-bit arch
This commit is contained in:
Andrew Poelstra 2018-08-20 14:11:26 +00:00 committed by GitHub
commit 85ddb66be0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -512,8 +512,8 @@ impl Builder {
/// Adds instructions to push some arbitrary data onto the stack /// Adds instructions to push some arbitrary data onto the stack
pub fn push_slice(mut self, data: &[u8]) -> Builder { pub fn push_slice(mut self, data: &[u8]) -> Builder {
// Start with a PUSH opcode // Start with a PUSH opcode
match data.len() { match data.len() as u64 {
n if n < opcodes::Ordinary::OP_PUSHDATA1 as usize => { self.0.push(n as u8); }, n if n < opcodes::Ordinary::OP_PUSHDATA1 as u64 => { self.0.push(n as u8); },
n if n < 0x100 => { n if n < 0x100 => {
self.0.push(opcodes::Ordinary::OP_PUSHDATA1 as u8); self.0.push(opcodes::Ordinary::OP_PUSHDATA1 as u8);
self.0.push(n as u8); self.0.push(n as u8);