From 7fc33d12c0cb36796ea2c1b47146588a295ad7e1 Mon Sep 17 00:00:00 2001 From: Simon Heath Date: Mon, 14 Nov 2016 12:10:54 -0500 Subject: [PATCH] Derived Debug on several little types that are handy to print out. --- src/datastructures.rs | 2 +- src/routing.rs | 8 +++++--- src/templating.rs | 1 + 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/datastructures.rs b/src/datastructures.rs index 460270d9..318c74b1 100644 --- a/src/datastructures.rs +++ b/src/datastructures.rs @@ -35,7 +35,7 @@ impl<'a, T: 'a> iter::Iterator for MultiDictIter<'a, T> { } /// This is used to deal with multiple values for the same key. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct MultiDict { map: HashMap>, } diff --git a/src/routing.rs b/src/routing.rs index 6c0b04ca..38f8a30c 100644 --- a/src/routing.rs +++ b/src/routing.rs @@ -64,7 +64,7 @@ fn parse_rule(rule: &str) -> Vec<(Option<&str>, &str)> { } /// The matcher holds the url regex object. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Matcher { pub regex: Regex } @@ -146,6 +146,7 @@ impl From for Matcher { /// Request Slash error. /// This is for example the case if you request `/foo` /// although the correct URL is `/foo/`. +#[derive(Debug)] pub struct RequestSlashError; @@ -158,7 +159,7 @@ pub enum MapAdapterMatched { /// A Rule represents one URL pattern. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Rule { /// The matcher is used to match the url path. pub matcher: Matcher, @@ -223,7 +224,7 @@ impl Rule { /// The map stores all the URL rules. -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct Map { rules: Vec, } @@ -250,6 +251,7 @@ impl Map { /// Does the URL matching and building based on runtime information. +#[derive(Debug)] pub struct MapAdapter<'m> { map: &'m Map, url_scheme: String, diff --git a/src/templating.rs b/src/templating.rs index a4c99f21..f4dc6c43 100644 --- a/src/templating.rs +++ b/src/templating.rs @@ -52,6 +52,7 @@ trait TemplateLoader { } /// A template loader that loads templates from the file system. +#[derive(Debug)] pub struct FileSystemLoader { search_path: String, }