remove `ops::Index` impls for `Signature`

This commit is contained in:
Andrew Poelstra 2018-08-24 22:56:40 +00:00
parent 7fbaf2f91b
commit 8d2347602a
2 changed files with 5 additions and 37 deletions

View File

@ -1,3 +1,7 @@
# (Unreleased)
* Remove `ops::Index` implementations for `Signature`
# 0.11.4 - 2018-11-04
* Add `FromStr` and `Display` for `Signature` and both key types

View File

@ -142,7 +142,7 @@
pub extern crate libc;
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;
#[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")]
impl ::serde::Serialize for Signature {
fn serialize<S: ::serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {