Skip to content

Commit

Permalink
fix(deps): update rust crate byte-unit to v5 (#528)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Loading branch information
renovate[bot] authored Apr 13, 2024
1 parent c8daf34 commit fedb015
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
14 changes: 2 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions crates/robbb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ thiserror = "1.0"
serde_json = "1"
serde = "1"
maplit = "1"
byte-unit = "5.1.4"
byte-unit = { version = "5.1", features = ["u128"] }
url = "2"
regex = "1"
reqwest = { version = "0.11" }
Expand Down Expand Up @@ -49,10 +49,14 @@ robbb_commands = { path = "../robbb_commands" }
tracing-logfmt-otel = { version = "0.2.0" }

opentelemetry = { version = "0.21.0", features = ["trace", "logs"] }
opentelemetry-otlp = { version = "0.14.0", features = ["http-proto", "reqwest-client", "grpc-tonic"] }
opentelemetry-otlp = { version = "0.14.0", features = [
"http-proto",
"reqwest-client",
"grpc-tonic",
] }
opentelemetry_sdk = { version = "0.21.2", features = ["rt-tokio"] }
tracing-opentelemetry = "0.22.0"


pyroscope = "0.5.7"
pyroscope_pprofrs = "0.2"
pyroscope_pprofrs = "0.2"
4 changes: 2 additions & 2 deletions crates/robbb_commands/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ thiserror = "1.0"
serde_json = "1"
serde = "1"
maplit = "1"
byte-unit = "4.0"
byte-unit = { version = "5.1", features = ["u128"] }
regex = "1"
reqwest = { version = "0.11" }
tokio = { version = "1.21", features = ["macros", "fs", "rt-multi-thread"]}
tokio = { version = "1.21", features = ["macros", "fs", "rt-multi-thread"] }
tokio-util = { version = "0.7", features = ["compat"] }
futures = "0.3"

Expand Down
5 changes: 4 additions & 1 deletion crates/robbb_commands/src/commands/fetch/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ pub fn format_fetch_field_value(field_name: &FetchField, value: String) -> Optio
fn format_bytes(s: &str) -> String {
let as_num = s.parse::<u128>();
match as_num {
Ok(n) => byte_unit::Byte::from_bytes(n).get_appropriate_unit(false).to_string(),
Ok(n) => byte_unit::Byte::from_u128(n)
.unwrap()
.get_appropriate_unit(byte_unit::UnitType::Decimal)
.to_string(),
Err(_) => s.to_string(),
}
}
Expand Down
11 changes: 6 additions & 5 deletions crates/robbb_commands/src/commands/fetch/setfetch.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
use chrono::Utc;
use poise::serenity_prelude::Attachment;
use robbb_util::cdn_hack;
use std::str::FromStr;

use super::*;
use std::collections::HashMap;

const SETFETCH_USAGE: &str = indoc::indoc!("
Run this:
Run this:
`curl -s https://raw.githubusercontent.com/unixporn/robbb/master/fetcher.sh | sh`
and follow the instructions. It's recommended that you download and read the script before running it,
as piping curl to sh isn't always the safest practice. (<https://blog.dijit.sh/don-t-pipe-curl-to-bash>)
and follow the instructions. It's recommended that you download and read the script before running it,
as piping curl to sh isn't always the safest practice. (<https://blog.dijit.sh/don-t-pipe-curl-to-bash>)
**NOTE**: use `/setfetch update` to manually update your fetch (including the image!).
**NOTE**: /git, /dotfiles, and /description are different commands"
Expand Down Expand Up @@ -73,9 +74,9 @@ pub async fn set_fetch_update(

let memory = match memory {
Some(memory) => Some(
byte_unit::Byte::from_str(memory)
byte_unit::Byte::from_str(&memory)
.user_error("Malformed value provided for Memory")?
.get_bytes()
.as_u128()
.to_string(),
),
_ => None,
Expand Down

0 comments on commit fedb015

Please sign in to comment.