fixup smol demo comments
// NOTE: this demo requires `--feature smol`.
-// futures_lite or futures would work. you'd just need the StreamExt trait to
-// iterate over EventStream
+// `futures_lite` or `futures` would work. you'd just need the `StreamExt` trait to iterate over `EventStream`
use futures_lite::*;
use twitchchat::{commands, connector, messages, rate_limit::NullBlocker, runner::Status};
@@ -14,7 +13,7 @@ fn get_user_config() -> twitchchat::UserConfig {
let name = expect_env_var("TWITCH_NAME");
let token = expect_env_var("TWITCH_TOKEN");
- // you need a UserConfig to connect to Twitch
+ // you need a `UserConfig` to connect to Twitch
twitchchat::UserConfig::builder()
// the name of the associated twitch account
.name(name)
@@ -51,11 +50,8 @@ fn main() {
// and the raw irc message
let mut all = dispatcher.subscribe::<messages::IrcMessage>().await;
- // 'subscribe' returns a stream, so we'll spawn a task and loop over it
- // until its done producing messages.
-
- // the event stream will 'close' when you the main loop exists or call
- // reset() on the dispatcher
+ // 'subscribe' returns a stream, so we'll spawn a task and loop over it until its done producing messages.
+ // the event stream will 'close' when you the main loop exists or call reset() on the dispatcher
smol::Task::spawn(async move {
while let Some(_msg) = all.next().await {
// do something with msg. we'll ignore it so the output isn't
@@ -75,8 +71,7 @@ fn main() {
// create a new runner. this is a provided async 'main loop'
let mut runner = twitchchat::AsyncRunner::new(dispatcher, user_config, connector);
- // which'll let you get a writer out. this'll let you pass in a rate
- // limiter and a blocking strategy.
+ // which'll let you get a writer out. this'll let you pass in a rate limiter and a blocking strategy.
let mut writer = runner.writer(None, NullBlocker::default());
smol::Task::spawn({
