fn response(self) -> Result<Response> {
        let (from, to) = min_max(self.from, self.to);

        if to - from > CAP {
            Response::error(
                format!(
                    "The difference between 'to' and 'from' must be no greater than {}",
                    CAP
                ),
                400,
            )
        } else {
            let values = (from..(to + if self.inclusive { 1 } else { 0 }))
                .into_iter()
                .map(|a| {
                    if a % 15 == 0 {
                        format!("{}{}", self.fizz, self.buzz)
                    } else if a % 5 == 0 {
                        self.buzz.clone()
                    } else if a % 3 == 0 {
                        self.fizz.clone()
                    } else {
                        a.to_string()
                    }
                })
                .collect::<Vec<String>>();

            Response::from_json(&json!({ "values": values }))
        }
    }
///
/// Run the service.
///
/// For `FizzBuzz`, this will not even bother to complete the request if the difference
/// between the two is higher than the `CAP` so as to not timeout the request (and also
/// to reduce the memory footprint).
///
/// **TODO**: Have a cap on the length of the two strings that are generated
///
Run the service.
For `FizzBuzz`, this will not even bother to complete the request if the difference
between the two is higher than the `CAP` so as to not timeout the request (and also
to reduce the memory footprint).


Run the service . For ` FizzBuzz ` this will not even bother to complete the request if the difference between the two is higher than the ` CAP ` so as to not timeout the request ( and also to reduce the memory footprint ) .
fn response(self) -> Result<Response> {
        let (from, to) = min_max(self.from, self.to);
        if to - from > CAP {
            Response::error(
                format!(
                    "The difference between 'to' and 'from' must be no greater than {}",
                    CAP
                ),
                400,
            )
        } else {
            let values = (from..(to + if self.inclusive { 1 } else { 0 }))
                .into_iter()
                .map(|a| {
                    if a % 15 == 0 {
                        format!("{}{}", self.fizz, self.buzz)
                    } else if a % 5 == 0 {
                        self.buzz.clone()
                    } else if a % 3 == 0 {
                        self.fizz.clone()
                    } else {
                        a.to_string()
                    }
                })
                .collect::<Vec<String>>();
            Response::from_json(&json!({ "values": values }))
        }
    }
fn response ( self ) -> Result < Response > { let ( from , to ) = min_max ( self . from , self . to ) ; if to - from > CAP { Response :: error ( format ! ( " " CAP ) , 400 , ) } else { let values = ( from .. ( to + if self . inclusive { 1 } else { 0 } ) ) . into_iter ( ) . map ( | a | { if a % 15 == 0 { format ! ( " " self fizz self buzz ) } else if a % 5 == 0 { self . buzz . clone ( ) } else if a % 3 == 0 { self . fizz . clone ( ) } else { a . to_string ( ) } } ) . collect :: < Vec < String > > ( ) ; Response :: from_json ( & json ! ( { " " values } ) ) } }
Run the service.
Run the service .
self