redirectionio 2.5.2

Redirection IO Library to handle matching rule, redirect and filtering headers and body.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use crate::router::Transform;

pub struct Replace {
    something: String,
    with: String,
}

impl Transform for Replace {
    fn transform(&self, str: String) -> String {
        str.replace(self.something.as_str(), self.with.as_str())
    }
}

impl Replace {
    pub fn new(something: String, with: String) -> Replace {
        Replace { something, with }
    }
}