26 lines
1.0 KiB
Diff
26 lines
1.0 KiB
Diff
--- src/wire/respond.rs
|
|
+++ replace respond -> String with String::new()
|
|
@@ -23,21 +23,10 @@
|
|
};
|
|
let rit = extras.rit_offered.then(|| run_twice(&spot, &decision));
|
|
Ok((decision, rit))
|
|
}
|
|
|
|
/// One request line in, one response line out (without trailing newline). Never panics.
|
|
/// With `ritOffered` the answer carries `rit` and `ritReason` after the contract keys.
|
|
pub fn respond(line: &str) -> String {
|
|
- match pipeline(line) {
|
|
- Ok((decision, None)) => encode(&decision),
|
|
- Ok((decision, Some((answer, reason)))) => {
|
|
- let Value::Object(mut felder) = encode_value(&decision) else {
|
|
- return encode(&decision);
|
|
- };
|
|
- felder.push(("rit".to_string(), Value::String(answer.name().to_string())));
|
|
- felder.push(("ritReason".to_string(), Value::String(reason)));
|
|
- render(&Value::Object(felder))
|
|
- }
|
|
- Err(fault) => encode(&Decision::abstain(format!("invalid request: {fault}"))),
|
|
- }
|
|
+ String::new() /* ~ changed by cargo-mutants ~ */
|
|
}
|