mirror of
https://framagit.org/veretcle/scootaloo.git
synced 2025-07-21 17:34:37 +02:00
refactor(fmt): delete String::from() format in favor of .to_string()/to_owned()
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user