From 8d2347602ad88c13b0a4774c4c2330d27118eb37 Mon Sep 17 00:00:00 2001 From: Andrew Poelstra Date: Fri, 24 Aug 2018 22:56:40 +0000 Subject: [PATCH] remove `ops::Index` impls for `Signature` --- CHANGELOG.md | 4 ++++ src/lib.rs | 38 +------------------------------------- 2 files changed, 5 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0c2d08..9058311 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/lib.rs b/src/lib.rs index 81cbc57..e29f2c8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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 for RecoverableSignature { } } -impl ops::Index for Signature { - type Output = u8; - - #[inline] - fn index(&self, index: usize) -> &u8 { - &self.0[index] - } -} - -impl ops::Index> for Signature { - type Output = [u8]; - - #[inline] - fn index(&self, index: ops::Range) -> &[u8] { - &self.0[index] - } -} - -impl ops::Index> for Signature { - type Output = [u8]; - - #[inline] - fn index(&self, index: ops::RangeFrom) -> &[u8] { - &self.0[index.start..] - } -} - -impl ops::Index for Signature { - type Output = [u8]; - - #[inline] - fn index(&self, _: ops::RangeFull) -> &[u8] { - &self.0[..] - } -} - #[cfg(feature = "serde")] impl ::serde::Serialize for Signature { fn serialize(&self, s: S) -> Result {