removed unused imports

This commit is contained in:
murmeldin 2025-01-06 08:09:42 +01:00
parent 1f75e0cc94
commit 49ceea6871
3 changed files with 4 additions and 5 deletions

View file

@ -4,9 +4,7 @@ use std::env;
use std::error::Error;
use std::fmt::Display;
use std::io::IsTerminal;
use std::os::linux::raw::stat;
use std::time::Instant;
use cccron_lib::config_spec::{self, CfgField, CfgGroup, CfgSpec};
use cccron_lib::date;
use cccron_lib::email::{self, Email, SimpleEmail};

View file

@ -125,6 +125,7 @@ impl MatrixClient {
if response.status().is_success() {
Ok(response.json()?)
} else {
// println!("These were the parameters: {}", params);
Err(format!("Request failed: {}", response.status()).into())
}
}
@ -228,11 +229,12 @@ impl MatrixClient {
) -> Result<Value, Box<dyn Error>> {
let formatted_text = Self::format_matrix_html(text.to_string())?;
let content = HashMap::from([
("type", "m.room.message"),
("msgtype", "m.text"),
("body", text),
("format", "org.matrix.custom.html"),
("formatted_body", &formatted_text),
//("m.mentions", "{}"),
("m.mentions", "{}"),
]);
self.send_room_event(&room_id, "m.room.message", &content)
}

View file

@ -1,6 +1,5 @@
use std::cell::OnceCell;
use std::error::Error;
use std::f64::consts::E;
use chrono::{Datelike, NaiveDate, Utc};
use colored::Colorize;
@ -302,7 +301,7 @@ impl Mediawiki {
if let Some(info) = error.get("info") {
if info == "The page you tried to create has been created already." {
verboseln!(
"The page you tried to create has been created already. Continuing..."
"The page you tried to create has been created already. Continuing without modifying the site..."
)
} else {
println!(