Format with rustfmt
All checks were successful
ci / check (push) Successful in 44s

This commit is contained in:
Jean Chevronnet 2026-07-29 19:17:16 +00:00
parent facbde55bd
commit 7846f91afe
No known key found for this signature in database
GPG key ID: 439666D63A9477E4
11 changed files with 209 additions and 54 deletions

View file

@ -5,7 +5,14 @@ use rustbot::bot::module::{Action, Command, Module};
use rustbot::bot::modules::weather::{format_weather, parse_db, to_json, Weather};
fn cmd<'a>(sender: &'a str, name: &'a str, args: &'a [&'a str]) -> Command<'a> {
Command { sender, reply_to: "#chan", name, args, prefix: ">", network: "test" }
Command {
sender,
reply_to: "#chan",
name,
args,
prefix: ">",
network: "test",
}
}
fn reply(actions: &[Action]) -> &str {
@ -36,7 +43,10 @@ fn parse_db_tolerates_junk() {
assert!(parse_db("").is_empty());
assert!(parse_db("not json").is_empty());
assert_eq!(parse_db("{}").len(), 0);
assert_eq!(parse_db("{\"a\":\"b\"}").get("a").map(String::as_str), Some("b"));
assert_eq!(
parse_db("{\"a\":\"b\"}").get("a").map(String::as_str),
Some("b")
);
}
#[test]