1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-04-20 06:54:46 +00:00

remove the annoying ToString type when what we really need is a &str

This commit is contained in:
Dominic 2020-03-30 22:42:22 +02:00
parent c508ac878d
commit 1d1682a03d
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
3 changed files with 17 additions and 17 deletions

View file

@ -60,7 +60,7 @@ pub trait WithOpenapi<D>
/// any RESTful `Resource` with a path.
pub trait DrawResources
{
fn resource<R : Resource, T : ToString>(&mut self, path : T);
fn resource<R : Resource>(&mut self, path : &str);
}
/// This trait allows to draw routes within an resource. Use this only inside the
@ -356,14 +356,14 @@ macro_rules! implDrawResourceRoutes {
C : PipelineHandleChain<P> + Copy + Send + Sync + 'static,
P : RefUnwindSafe + Send + Sync + 'static
{
fn resource<R : Resource, T : ToString>(&mut self, path : T)
fn resource<R : Resource>(&mut self, path : &str)
{
R::setup((self, path.to_string()));
R::setup((self, path));
}
}
#[allow(clippy::redundant_closure)] // doesn't work because of type parameters
impl<'a, C, P> DrawResourceRoutes for (&mut $implType<'a, C, P>, String)
impl<'a, C, P> DrawResourceRoutes for (&mut $implType<'a, C, P>, &str)
where
C : PipelineHandleChain<P> + Copy + Send + Sync + 'static,
P : RefUnwindSafe + Send + Sync + 'static