remove `ops::Index` impls for `Signature`
This commit is contained in:
parent
7fbaf2f91b
commit
8d2347602a
|
@ -1,3 +1,7 @@
|
||||||
|
# (Unreleased)
|
||||||
|
|
||||||
|
* Remove `ops::Index` implementations for `Signature`
|
||||||
|
|
||||||
# 0.11.4 - 2018-11-04
|
# 0.11.4 - 2018-11-04
|
||||||
|
|
||||||
* Add `FromStr` and `Display` for `Signature` and both key types
|
* Add `FromStr` and `Display` for `Signature` and both key types
|
||||||
|
|
38
src/lib.rs
38
src/lib.rs
|
@ -142,7 +142,7 @@
|
||||||
pub extern crate libc;
|
pub extern crate libc;
|
||||||
|
|
||||||
use libc::size_t;
|
use libc::size_t;
|
||||||
use std::{error, fmt, ops, ptr, str};
|
use std::{error, fmt, ptr, str};
|
||||||
#[cfg(any(test, feature = "rand"))] use rand::Rng;
|
#[cfg(any(test, feature = "rand"))] use rand::Rng;
|
||||||
|
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
|
@ -442,42 +442,6 @@ impl From<ffi::RecoverableSignature> for RecoverableSignature {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ops::Index<usize> for Signature {
|
|
||||||
type Output = u8;
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn index(&self, index: usize) -> &u8 {
|
|
||||||
&self.0[index]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ops::Index<ops::Range<usize>> for Signature {
|
|
||||||
type Output = [u8];
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn index(&self, index: ops::Range<usize>) -> &[u8] {
|
|
||||||
&self.0[index]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ops::Index<ops::RangeFrom<usize>> for Signature {
|
|
||||||
type Output = [u8];
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn index(&self, index: ops::RangeFrom<usize>) -> &[u8] {
|
|
||||||
&self.0[index.start..]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl ops::Index<ops::RangeFull> for Signature {
|
|
||||||
type Output = [u8];
|
|
||||||
|
|
||||||
#[inline]
|
|
||||||
fn index(&self, _: ops::RangeFull) -> &[u8] {
|
|
||||||
&self.0[..]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
impl ::serde::Serialize for Signature {
|
impl ::serde::Serialize for Signature {
|
||||||
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
|
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
|
||||||
|
|
Loading…
Reference in New Issue