• Hero Bird's avatar
    Optimize Key and KeyPtr primitives (#433) · f0747864
    Hero Bird authored
    * [chores] add primitives/target to gitignore
    
    * [primitives] add Key2 replacement for Key
    
    # Conflicts:
    #	primitives/src/lib.rs
    
    * [primitives] add KeyPtr2 replacement for KeyPtr
    
    * [primitives] add benchmark tests for Key, Key2, KeyPtr and KeyPtr2
    
    * [primitives] rename some benches
    
    * [primitives] inline some KeyPtr methods
    
    This is mainly to make comparison between old and new KeyPtr fairer.
    
    # Conflicts:
    #	primitives/src/key_ptr.rs
    
    * [primitives] carve out fallback for big-endian to_bytes
    
    This makes it better testable.
    
    * [primitives] include big-endian fallback procedures into a test
    
    * [primitives] add doc comment to Key2
    
    * [primitives] apply rustfmt
    
    * [primitives] fix clippy warning
    
    * [primitives] add repr(transparent) to Key2
    
    * [primitives] replace AsRef<[u8; 32]> impl with Key2::try_as_bytes method
    
    * [primitives] add SAFETY comment to unsafe block
    
    * [primitives] apply rustfmt
    
    * [primitives] add Display impl to Key2
    f0747864