From 4d0f5f3dc77c95ed95f4f6816f49d770e015f89f Mon Sep 17 00:00:00 2001 From: Diggory Blake Date: Mon, 14 Aug 2023 15:54:55 +0100 Subject: [PATCH] Broaden debug implementation --- Cargo.toml | 2 +- src/state.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5cb5e5c..a3ba514 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "aerosol" -version = "1.0.0-alpha.7" +version = "1.0.0-alpha.8" authors = ["Diggory Blake "] edition = "2018" description = "Simple dependency injection for Rust" diff --git a/src/state.rs b/src/state.rs index 9b6329e..7aa2e18 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,4 +1,4 @@ -use std::{any::Any, marker::PhantomData, sync::Arc, task::Poll}; +use std::{any::Any, fmt::Debug, marker::PhantomData, sync::Arc, task::Poll}; use anymap::hashbrown::{Entry, Map}; use frunk::{ @@ -20,13 +20,18 @@ pub(crate) struct InnerAero { /// Stores a collection of resources keyed on resource type. /// Provides methods for accessing this collection. /// Can be cheaply cloned. -#[derive(Debug)] #[repr(transparent)] pub struct Aero { pub(crate) inner: Arc>, pub(crate) phantom: PhantomData>, } +impl Debug for Aero { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + self.inner.fmt(f) + } +} + impl Aero { /// Construct a new instance of the type with no initial resources. pub fn new() -> Self {