Skip to content

Commit

Permalink
Clean up main loop
Browse files Browse the repository at this point in the history
  • Loading branch information
udoprog committed Jul 24, 2020
1 parent f92b507 commit fab9ab5
Show file tree
Hide file tree
Showing 16 changed files with 250 additions and 281 deletions.
159 changes: 86 additions & 73 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 3 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
[workspace]

members = [
"bot",
"web",
]

exclude = [
"tools/builder"
]
default-members = ["bot"]
members = ["bot", "web"]
exclude = ["tools/builder"]

[profile.release]
opt-level = 'z'
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,20 @@ You'll need Rust and a working compiler: https://rustup.rs/
After this, you build the project using cargo:

```bash
cargo build --bin oxidize
cargo build
```

If you want to run it directly from the project directory, you can do:

```bash
cargo run --bin oxidize
cargo run
```

If you want to run the bot with the most amount of diagnostics possible, you can
do the following:

```bash
env RUST_BACKTRACE=1 cargo +nightly run --bin oxidize -- --log oxidize=trace
env RUST_BACKTRACE=1 cargo +nightly run -- --log oxidize=trace
```

This will include backtraces on errors, which is currently an [unstable feature].
Expand Down
2 changes: 1 addition & 1 deletion bot/src/api/setbac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ impl From<Arc<player::Item>> for Item {
track_id: i.track_id.to_string(),
track_url: i.track_id.url(),
user: i.user.clone(),
duration: utils::compact_duration(&i.duration),
duration: utils::compact_duration(i.duration),
}
}
}
2 changes: 1 addition & 1 deletion bot/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ impl Context {
if let Some(duration) = cooldown.check(now.clone()) {
self.respond(format!(
"Cooldown in effect for {}",
utils::compact_duration(&duration),
utils::compact_duration(duration),
))
.await;

Expand Down
4 changes: 2 additions & 2 deletions bot/src/irc/currency_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ impl command::Handler for Handler {
match result {
Ok(balance) => {
let balance = balance.unwrap_or_default();
let watch_time = utils::compact_duration(&balance.watch_time().as_std());
let watch_time = utils::compact_duration(balance.watch_time().as_std());

respond!(
user,
Expand All @@ -70,7 +70,7 @@ impl command::Handler for Handler {
match currency.balance_of(ctx.channel(), to_show.as_str()).await {
Ok(balance) => {
let balance = balance.unwrap_or_default();
let watch_time = utils::compact_duration(&balance.watch_time().as_std());
let watch_time = utils::compact_duration(balance.watch_time().as_std());

respond!(
ctx,
Expand Down
Loading

0 comments on commit fab9ab5

Please sign in to comment.