fn response_formatter(response: String) -> String {
    debug!("Format response \"{}\"", response);
    if response.len() < 1990 {
        // Response falls within size constraints
        return format!("```\n{}\n```", response);
    } else {
        // we trim to 1981 chars because [TRIMMED] is 9 chars
        let short_repsonse = &response[0..1981]; // TODO: maybe do this in place with a mutable string
        return format!("```{}[TRIMMED]```", short_repsonse);
    }
}
/// Given some stdout or stderr data, format it so that it can be rendered by discord
Given some stdout or stderr data, format it so that it can be rendered by discord
Given some stdout or stderr data format it so that it can be rendered by discord
fn response_formatter(response: String) -> String {
    debug!("Format response \"{}\"", response);
    if response.len() < 1990 {
        // Response falls within size constraints
        return format!("```\n{}\n```", response);
    } else {
        // we trim to 1981 chars because [TRIMMED] is 9 chars
        let short_repsonse = &response[0..1981]; // TODO: maybe do this in place with a mutable string
        return format!("```{}[TRIMMED]```", short_repsonse);
    }
}
fn response_formatter ( response : String ) -> String { debug ! ( " \" \" " response ) ; if response . len ( ) < 1990 { // Response falls within size constraints return format ! ( " \n \n " response ) ; } else { // we trim to 1981 chars because [TRIMMED] is 9 chars let short_repsonse = & response [ 0 .. 1981 ] ; // TODO: maybe do this in place with a mutable string return format ! ( " " short_repsonse ) ; } }
Given some stdout or stderr data, format it so that it can be rendered by discord
Given some stdout or stderr data format it so that it can be rendered by discord
response
String
response
String