1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-06-13 10:49:26 +00:00

update doc strings

This commit is contained in:
Nikolay Kim 2017-10-16 20:13:47 -07:00
parent de2f604fea
commit 92b81899dd
2 changed files with 5 additions and 1 deletions

View file

@ -123,6 +123,9 @@ fn parse(pattern: &str) -> String {
re
}
/// Route match information
///
/// If resource path contains variable patterns, `Params` stores this variables.
#[derive(Debug)]
pub struct Params {
text: String,
@ -158,6 +161,7 @@ impl Params {
.and_then(|m| m.map(|(start, end)| &self.text[start..end]))
}
/// Get matched parameter by name
pub fn get(&self, key: &str) -> Option<&str> {
self.names.get(key).and_then(|&i| self.by_idx(i - 1))
}

View file

@ -52,7 +52,7 @@ impl Router {
/// A variable part is specified in the form `{identifier}`, where
/// the identifier can be used later in a request handler to access the matched
/// value for that part. This is done by looking up the identifier
/// in the Params object returned by `Request.match_info()` method.
/// in the `Params` object returned by `Request.match_info()` method.
///
/// By default, each part matches the regular expression `[^{}/]+`.
///