Use format shorthand in more places

pull/30/head
Dominik Nakamura 1 year ago
parent c2ffac1284
commit 67815f81c8
No known key found for this signature in database

@ -52,11 +52,11 @@ async fn main() -> Result<()> {
// Get and print out version information of OBS and obs-websocket. // Get and print out version information of OBS and obs-websocket.
let version = client.general().version().await?; let version = client.general().version().await?;
println!("{:#?}", version); println!("{version:#?}");
// Get a list of available scenes and print them out. // Get a list of available scenes and print them out.
let scene_list = client.scenes().list().await?; let scene_list = client.scenes().list().await?;
println!("{:#?}", scene_list); println!("{scene_list:#?}");
Ok(()) Ok(())
} }

@ -17,7 +17,7 @@ async fn main() -> Result<()> {
pin_mut!(events); pin_mut!(events);
while let Some(event) = events.next().await { while let Some(event) = events.next().await {
println!("{:#?}", event); println!("{event:#?}");
} }
Ok(()) Ok(())

@ -13,10 +13,10 @@ async fn main() -> Result<()> {
let client = Client::connect("localhost", 4455, env::var("OBS_PASSWORD").ok()).await?; let client = Client::connect("localhost", 4455, env::var("OBS_PASSWORD").ok()).await?;
let version = client.general().version().await?; let version = client.general().version().await?;
println!("{:#?}", version); println!("{version:#?}");
let scene_list = client.scenes().list().await?.scenes; let scene_list = client.scenes().list().await?.scenes;
println!("{:#?}", scene_list); println!("{scene_list:#?}");
Ok(()) Ok(())
} }

@ -414,8 +414,8 @@ impl From<CustomSize> for String {
CustomSize::SixteenToTen => "16:10".to_owned(), CustomSize::SixteenToTen => "16:10".to_owned(),
CustomSize::FourToThree => "4:3".to_owned(), CustomSize::FourToThree => "4:3".to_owned(),
CustomSize::OneToOne => "1:1".to_owned(), CustomSize::OneToOne => "1:1".to_owned(),
CustomSize::CustomRatio(w, h) => format!("{}:{}", w, h), CustomSize::CustomRatio(w, h) => format!("{w}:{h}"),
CustomSize::CustomSize(w, h) => format!("{}x{}", w, h), CustomSize::CustomSize(w, h) => format!("{w}x{h}"),
} }
} }
} }

Loading…
Cancel
Save