From 90c6cc90b6c1e80d2f26434f37d687b39a692945 Mon Sep 17 00:00:00 2001 From: Michael Krasnitski Date: Fri, 6 Jan 2023 14:26:24 -0500 Subject: Remove unused impls of `AsRef for T` --- rust/src/backgroundtask.rs | 6 ------ rust/src/binaryview.rs | 2 +- rust/src/debuginfo.rs | 12 ------------ rust/src/disassembly.rs | 6 ------ rust/src/downloadprovider.rs | 6 ------ rust/src/flowgraph.rs | 12 ------------ rust/src/metadata.rs | 6 ------ rust/src/settings.rs | 6 ------ rust/src/tags.rs | 12 ------------ 9 files changed, 1 insertion(+), 67 deletions(-) (limited to 'rust/src') diff --git a/rust/src/backgroundtask.rs b/rust/src/backgroundtask.rs index 2557a5f3..7a24b62c 100644 --- a/rust/src/backgroundtask.rs +++ b/rust/src/backgroundtask.rs @@ -123,12 +123,6 @@ unsafe impl<'a> CoreArrayWrapper<'a> for BackgroundTask { } } -impl AsRef for BackgroundTask { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for BackgroundTask { type Owned = Ref; diff --git a/rust/src/binaryview.rs b/rust/src/binaryview.rs index 2c9c5cc2..26b0bae2 100644 --- a/rust/src/binaryview.rs +++ b/rust/src/binaryview.rs @@ -743,7 +743,7 @@ pub trait BinaryViewExt: BinaryViewBase { BNShowGraphReport( self.as_ref().handle, raw_name.as_ref().as_ptr() as *mut _, - graph.as_ref().handle, + graph.handle, ); } } diff --git a/rust/src/debuginfo.rs b/rust/src/debuginfo.rs index 3ec0691c..36cbc5b7 100644 --- a/rust/src/debuginfo.rs +++ b/rust/src/debuginfo.rs @@ -252,12 +252,6 @@ unsafe impl RefCountable for DebugInfoParser { } } -impl AsRef for DebugInfoParser { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for DebugInfoParser { type Owned = Ref; @@ -811,12 +805,6 @@ unsafe impl RefCountable for DebugInfo { } } -impl AsRef for DebugInfo { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for DebugInfo { type Owned = Ref; diff --git a/rust/src/disassembly.rs b/rust/src/disassembly.rs index 950335a3..3d94f3bd 100644 --- a/rust/src/disassembly.rs +++ b/rust/src/disassembly.rs @@ -437,12 +437,6 @@ impl DisassemblySettings { } } -impl AsRef for DisassemblySettings { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for DisassemblySettings { type Owned = Ref; diff --git a/rust/src/downloadprovider.rs b/rust/src/downloadprovider.rs index 7de8704c..441714b6 100644 --- a/rust/src/downloadprovider.rs +++ b/rust/src/downloadprovider.rs @@ -79,12 +79,6 @@ unsafe impl<'a> CoreArrayWrapper<'a> for DownloadProvider { } } -impl AsRef for DownloadProvider { - fn as_ref(&self) -> &Self { - self - } -} - pub struct DownloadInstanceOutputCallbacks { pub write: Option usize>>, pub progress: Option bool>>, diff --git a/rust/src/flowgraph.rs b/rust/src/flowgraph.rs index a0e6caaa..0f959429 100644 --- a/rust/src/flowgraph.rs +++ b/rust/src/flowgraph.rs @@ -106,12 +106,6 @@ unsafe impl<'a> RefCountable for FlowGraphNode<'a> { } } -impl<'a> AsRef> for FlowGraphNode<'a> { - fn as_ref(&self) -> &Self { - self - } -} - impl<'a> ToOwned for FlowGraphNode<'a> { type Owned = Ref; @@ -161,12 +155,6 @@ unsafe impl RefCountable for FlowGraph { } } -impl AsRef for FlowGraph { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for FlowGraph { type Owned = Ref; diff --git a/rust/src/metadata.rs b/rust/src/metadata.rs index 1ccb9ae4..09c21ec9 100644 --- a/rust/src/metadata.rs +++ b/rust/src/metadata.rs @@ -347,12 +347,6 @@ unsafe impl<'a> CoreArrayWrapper<'a> for Metadata { } } -impl AsRef for Metadata { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for Metadata { type Owned = Ref; diff --git a/rust/src/settings.rs b/rust/src/settings.rs index d6d3cab4..d5720ff4 100644 --- a/rust/src/settings.rs +++ b/rust/src/settings.rs @@ -448,12 +448,6 @@ impl Settings { // TODO: register_setting but type-safely turn it into json } -impl AsRef for Settings { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for Settings { type Owned = Ref; diff --git a/rust/src/tags.rs b/rust/src/tags.rs index bc30cb32..91bd051c 100644 --- a/rust/src/tags.rs +++ b/rust/src/tags.rs @@ -69,12 +69,6 @@ unsafe impl RefCountable for Tag { } } -impl AsRef for Tag { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for Tag { type Owned = Ref; @@ -172,12 +166,6 @@ unsafe impl RefCountable for TagType { } } -impl AsRef for TagType { - fn as_ref(&self) -> &Self { - self - } -} - impl ToOwned for TagType { type Owned = Ref; -- cgit v1.3.1