use crate::{
    async_trait,
    traits::{ErrorTrait, InstanceTrait},
    Http, Result,
};
use soph_config::error::Error;
use soph_core::{error::ContainerError, support::Container};

#[async_trait]
impl InstanceTrait for Http {
    type Error = Error;

    async fn register(_: &Container) -> Result<Self, ContainerError>
    where
        Self: Sized,
    {
        Ok(Self::new().map_err(Error::wrap)?)
    }
}
