mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 23:51:05 +00:00
Remove bounds on Config trait that aren't strictly necessary (#389)
* Use Derivative to skip bounds on T when they aren't necessary, and remove unnecessary bounds on Config * loosen a couple more derive bounds * Use PhantomDataSendSync to avoid accidentally removing Send+Sync bounds
This commit is contained in:
+15
-17
@@ -14,16 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with subxt. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use codec::{
|
||||
Codec,
|
||||
Compact,
|
||||
Decode,
|
||||
Encode,
|
||||
Error as CodecError,
|
||||
Input,
|
||||
};
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::{
|
||||
metadata::{
|
||||
EventMetadata,
|
||||
@@ -33,8 +23,18 @@ use crate::{
|
||||
Error,
|
||||
Event,
|
||||
Metadata,
|
||||
PhantomDataSendSync,
|
||||
Phase,
|
||||
};
|
||||
use codec::{
|
||||
Codec,
|
||||
Compact,
|
||||
Decode,
|
||||
Encode,
|
||||
Error as CodecError,
|
||||
Input,
|
||||
};
|
||||
use derivative::Derivative;
|
||||
use scale_info::{
|
||||
TypeDef,
|
||||
TypeDefPrimitive,
|
||||
@@ -69,16 +69,14 @@ impl RawEvent {
|
||||
}
|
||||
|
||||
/// Events decoder.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct EventsDecoder<T> {
|
||||
#[derive(Derivative)]
|
||||
#[derivative(Clone(bound = ""), Debug(bound = ""))]
|
||||
pub struct EventsDecoder<T: Config> {
|
||||
metadata: Metadata,
|
||||
marker: PhantomData<T>,
|
||||
marker: PhantomDataSendSync<T>,
|
||||
}
|
||||
|
||||
impl<T> EventsDecoder<T>
|
||||
where
|
||||
T: Config,
|
||||
{
|
||||
impl<T: Config> EventsDecoder<T> {
|
||||
/// Creates a new `EventsDecoder`.
|
||||
pub fn new(metadata: Metadata) -> Self {
|
||||
Self {
|
||||
|
||||
Reference in New Issue
Block a user