removed unused imports
This commit is contained in:
parent
1f75e0cc94
commit
49ceea6871
|
@ -4,9 +4,7 @@ use std::env;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fmt::Display;
|
use std::fmt::Display;
|
||||||
use std::io::IsTerminal;
|
use std::io::IsTerminal;
|
||||||
use std::os::linux::raw::stat;
|
|
||||||
use std::time::Instant;
|
use std::time::Instant;
|
||||||
|
|
||||||
use cccron_lib::config_spec::{self, CfgField, CfgGroup, CfgSpec};
|
use cccron_lib::config_spec::{self, CfgField, CfgGroup, CfgSpec};
|
||||||
use cccron_lib::date;
|
use cccron_lib::date;
|
||||||
use cccron_lib::email::{self, Email, SimpleEmail};
|
use cccron_lib::email::{self, Email, SimpleEmail};
|
||||||
|
|
|
@ -125,6 +125,7 @@ impl MatrixClient {
|
||||||
if response.status().is_success() {
|
if response.status().is_success() {
|
||||||
Ok(response.json()?)
|
Ok(response.json()?)
|
||||||
} else {
|
} else {
|
||||||
|
// println!("These were the parameters: {}", params);
|
||||||
Err(format!("Request failed: {}", response.status()).into())
|
Err(format!("Request failed: {}", response.status()).into())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -228,11 +229,12 @@ impl MatrixClient {
|
||||||
) -> Result<Value, Box<dyn Error>> {
|
) -> Result<Value, Box<dyn Error>> {
|
||||||
let formatted_text = Self::format_matrix_html(text.to_string())?;
|
let formatted_text = Self::format_matrix_html(text.to_string())?;
|
||||||
let content = HashMap::from([
|
let content = HashMap::from([
|
||||||
|
("type", "m.room.message"),
|
||||||
("msgtype", "m.text"),
|
("msgtype", "m.text"),
|
||||||
("body", text),
|
("body", text),
|
||||||
("format", "org.matrix.custom.html"),
|
("format", "org.matrix.custom.html"),
|
||||||
("formatted_body", &formatted_text),
|
("formatted_body", &formatted_text),
|
||||||
//("m.mentions", "{}"),
|
("m.mentions", "{}"),
|
||||||
]);
|
]);
|
||||||
self.send_room_event(&room_id, "m.room.message", &content)
|
self.send_room_event(&room_id, "m.room.message", &content)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use std::cell::OnceCell;
|
use std::cell::OnceCell;
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::f64::consts::E;
|
|
||||||
|
|
||||||
use chrono::{Datelike, NaiveDate, Utc};
|
use chrono::{Datelike, NaiveDate, Utc};
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
|
@ -302,7 +301,7 @@ impl Mediawiki {
|
||||||
if let Some(info) = error.get("info") {
|
if let Some(info) = error.get("info") {
|
||||||
if info == "The page you tried to create has been created already." {
|
if info == "The page you tried to create has been created already." {
|
||||||
verboseln!(
|
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 {
|
} else {
|
||||||
println!(
|
println!(
|
||||||
|
|
Loading…
Reference in a new issue