mirror of
https://github.com/katanemo/plano.git
synced 2026-05-18 13:45:15 +02:00
More idiomatic conversion (#47)
* More idiomatic conversion Signed-off-by: José Ulises Niño Rivera <junr03@users.noreply.github.com> * errors Signed-off-by: José Ulises Niño Rivera <junr03@users.noreply.github.com> --------- Signed-off-by: José Ulises Niño Rivera <junr03@users.noreply.github.com>
This commit is contained in:
parent
de8c706a69
commit
3c5ac65e2a
1 changed files with 6 additions and 6 deletions
|
|
@ -35,11 +35,11 @@ pub struct Header {
|
|||
pub value: String,
|
||||
}
|
||||
|
||||
impl Header {
|
||||
fn into_config(self) -> configuration::Header {
|
||||
configuration::Header {
|
||||
key: self.key,
|
||||
value: Some(self.value),
|
||||
impl From<Header> for configuration::Header {
|
||||
fn from(header: Header) -> Self {
|
||||
Self {
|
||||
key: header.key,
|
||||
value: Some(header.value),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -99,7 +99,7 @@ impl RatelimitMap {
|
|||
Some(limit) => limit,
|
||||
};
|
||||
|
||||
let mut config_selector = selector.into_config();
|
||||
let mut config_selector = configuration::Header::from(selector);
|
||||
|
||||
let (limit, limit_key) = match provider_limits.get(&config_selector) {
|
||||
// This is a specific limit, i.e one that was configured with both key, and value.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue