fn play_or_eval(args: &Args, result_handling: ResultHandling) -> Result<(), Error> {
    let code = maybe_wrap(crate::extract_code(args.body)?, result_handling);
    let (flags, flag_parse_errors) = parse_flags(args);

    let mut result: PlayResult = args
        .http
        .post("https://play.rust-lang.org/execute")
        .json(&PlaygroundRequest {
            code: &code,
            channel: flags.channel,
            crate_type: if code.contains("fn main") {
                CrateType::Binary
            } else {
                CrateType::Library
            },
            edition: flags.edition,
            mode: flags.mode,
            tests: false,
        })
        .send()?
        .json()?;

    format_play_eval_stderr(&mut result);

    send_reply(args, result, &code, &flags, &flag_parse_errors)
}
// play and eval work similarly, so this function abstracts over the two
play and eval work similarly, so this function abstracts over the two
play and eval work similarly so this function abstracts over the two
fn play_or_eval(args: &Args, result_handling: ResultHandling) -> Result<(), Error> {
    let code = maybe_wrap(crate::extract_code(args.body)?, result_handling);
    let (flags, flag_parse_errors) = parse_flags(args);
    let mut result: PlayResult = args
        .http
        .post("https://play.rust-lang.org/execute")
        .json(&PlaygroundRequest {
            code: &code,
            channel: flags.channel,
            crate_type: if code.contains("fn main") {
                CrateType::Binary
            } else {
                CrateType::Library
            },
            edition: flags.edition,
            mode: flags.mode,
            tests: false,
        })
        .send()?
        .json()?;
    format_play_eval_stderr(&mut result);
    send_reply(args, result, &code, &flags, &flag_parse_errors)
}
fn play_or_eval ( args : & Args , result_handling : ResultHandling ) -> Result < ( ) , Error > { let code = maybe_wrap ( crate :: extract_code ( args . body ) ? , result_handling ) ; let ( flags , flag_parse_errors ) = parse_flags ( args ) ; let mut result : PlayResult = args . http . post ( " " ) . json ( & PlaygroundRequest { code : & code , channel : flags . channel , crate_type : if code . contains ( " " ) { CrateType :: Binary } else { CrateType :: Library } , edition : flags . edition , mode : flags . mode , tests : false , } ) . send ( ) ? . json ( ) ? ; format_play_eval_stderr ( & mut result ) ; send_reply ( args , result , & code , & flags , & flag_parse_errors ) }
play and eval work similarly, so this function abstracts over the two
play and eval work similarly so this function abstracts over the two
args
&Args
result_handling
ResultHandling
args
&Args
result_handling
ResultHandling