diff --git a/examples/register/mod.rs b/examples/register/mod.rs index eb86b7b..d4cb02e 100644 --- a/examples/register/mod.rs +++ b/examples/register/mod.rs @@ -54,7 +54,10 @@ pub async fn register() -> Result { #[cfg(feature = "toml")] pub fn read_line(message: impl AsRef) -> Result { - println!("{}", message.as_ref()); + use std::io::Write; + + print!("{}", message.as_ref()); + io::stdout().flush()?; let mut input = String::new(); io::stdin().read_line(&mut input)?; @@ -63,6 +66,7 @@ pub fn read_line(message: impl AsRef) -> Result { } #[cfg(feature = "toml")] +#[allow(dead_code)] pub fn bool_input(message: impl AsRef, default: bool) -> Result { let input = read_line(message.as_ref())?; if let Some(first_char) = input.chars().next() { diff --git a/examples/upload_photo.rs b/examples/upload_photo.rs index 4492945..d53a584 100644 --- a/examples/upload_photo.rs +++ b/examples/upload_photo.rs @@ -6,7 +6,7 @@ use mastodon_async::{Result, StatusBuilder, Visibility}; #[cfg(feature = "toml")] async fn run() -> Result<()> { use register::bool_input; - femme::with_level(femme::LevelFilter::Trace); + femme::with_level(femme::LevelFilter::Info); let mastodon = register::get_mastodon_data().await?; let input = register::read_line("Enter the path to the photo you'd like to post: ")?; let description = register::read_line("describe the media? ")?; @@ -17,6 +17,10 @@ async fn run() -> Result<()> { }; let media = mastodon.media(input, description).await?; + let media = mastodon + .wait_for_processing(media, Default::default()) + .await?; + println!("media upload available at: {}", media.url); let status = StatusBuilder::new() .status("Mastodon-async photo upload example/demo (automated post)") .media_ids([media.id])