refactor(fmt): delete String::from() format in favor of .to_string()/to_owned()

This commit is contained in:
VC
2022-04-24 14:20:45 +02:00
parent 734f03f5a9
commit 905793af72
5 changed files with 27 additions and 27 deletions

View File

@@ -16,7 +16,7 @@ pub fn read_state(conn: &Connection, s: Option<u64>) -> Result<Option<TweetToToo
let query: String;
match s {
Some(i) => query = format!("SELECT * FROM tweet_to_toot WHERE tweet_id = {}", i),
None => query = String::from("SELECT * FROM tweet_to_toot ORDER BY tweet_id DESC LIMIT 1"),
None => query = "SELECT * FROM tweet_to_toot ORDER BY tweet_id DESC LIMIT 1".to_string(),
};
let mut stmt = conn.prepare(&query)?;
@@ -116,7 +116,7 @@ mod tests {
let t_in = TweetToToot {
tweet_id: 123456789,
toot_id: String::from("987654321"),
toot_id: "987654321".to_string(),
};
write_state(&conn, t_in).unwrap();
@@ -131,7 +131,7 @@ mod tests {
}).unwrap();
assert_eq!(t_out.tweet_id, 123456789);
assert_eq!(t_out.toot_id, String::from("987654321"));
assert_eq!(t_out.toot_id, "987654321".to_string());
remove_file(d).unwrap();
}