mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
[clippy] Fix clippy issues for crate sp-core (#8809)
* Fix clippy issues for crate sp-core * Update primitives/core/benches/bench.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Update primitives/core/src/ed25519.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * Remove clippy attributes * Missed a clippy attribute * remove clippy attributes for bechmarks as well Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -51,14 +51,14 @@ pub trait FetchRuntimeCode {
|
||||
/// Fetch the runtime `:code`.
|
||||
///
|
||||
/// If the `:code` could not be found/not available, `None` should be returned.
|
||||
fn fetch_runtime_code<'a>(&'a self) -> Option<Cow<'a, [u8]>>;
|
||||
fn fetch_runtime_code(&self) -> Option<Cow<[u8]>>;
|
||||
}
|
||||
|
||||
/// Wrapper to use a `u8` slice or `Vec` as [`FetchRuntimeCode`].
|
||||
pub struct WrappedRuntimeCode<'a>(pub std::borrow::Cow<'a, [u8]>);
|
||||
|
||||
impl<'a> FetchRuntimeCode for WrappedRuntimeCode<'a> {
|
||||
fn fetch_runtime_code<'b>(&'b self) -> Option<Cow<'b, [u8]>> {
|
||||
fn fetch_runtime_code(&self) -> Option<Cow<[u8]>> {
|
||||
Some(self.0.as_ref().into())
|
||||
}
|
||||
}
|
||||
@@ -67,7 +67,7 @@ impl<'a> FetchRuntimeCode for WrappedRuntimeCode<'a> {
|
||||
pub struct NoneFetchRuntimeCode;
|
||||
|
||||
impl FetchRuntimeCode for NoneFetchRuntimeCode {
|
||||
fn fetch_runtime_code<'a>(&'a self) -> Option<Cow<'a, [u8]>> {
|
||||
fn fetch_runtime_code(&self) -> Option<Cow<[u8]>> {
|
||||
None
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ impl<'a> RuntimeCode<'a> {
|
||||
}
|
||||
|
||||
impl<'a> FetchRuntimeCode for RuntimeCode<'a> {
|
||||
fn fetch_runtime_code<'b>(&'b self) -> Option<Cow<'b, [u8]>> {
|
||||
fn fetch_runtime_code(&self) -> Option<Cow<[u8]>> {
|
||||
self.code_fetcher.fetch_runtime_code()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user