Skip to content

Commit 42b25d9

Browse files
gizmomogwaiChristian Koestlinflxo
authored
chore: Bump thiserror version (#16)
* chore: Bump thiserrors version Fix trivial clippy warning to pass the ci checks. * Do not change the crate version --------- Co-authored-by: Christian Koestlin <[email protected]> Co-authored-by: Felix Obenhuber <[email protected]>
1 parent 5104c3e commit 42b25d9

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ env_logger = { version = "0.10", features = ["regex"], default-features = false
2020
lazy_static = { version = "1.4", optional = true }
2121
log = { version = "0.4", features = ["std"] }
2222
parking_lot = "0.12"
23-
thiserror = "1"
23+
thiserror = "2"
2424
time = { version = "0.3", features = ["formatting", "macros"] }
2525

2626
[target.'cfg(unix)'.dependencies]

src/events.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ impl EventValue {
4141
&EventValue::Void => 0,
4242
EventValue::Int(_) | EventValue::Float(_) => 1 + 4,
4343
EventValue::Long(_) => 1 + 8,
44-
EventValue::String(s) => 1 + 4 + s.as_bytes().len(),
44+
EventValue::String(s) => 1 + 4 + s.len(),
4545
EventValue::List(l) => 1 + 1 + l.iter().map(EventValue::serialized_size).sum::<usize>(),
4646
}
4747
}

src/logd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ impl LogdSocket {
7575
/// Send a log message to logd
7676
pub(crate) fn log(record: &Record) {
7777
// Tag and message len with null terminator.
78-
let tag_len = record.tag.bytes().len() + 1;
79-
let message_len = record.message.bytes().len() + 1;
78+
let tag_len = record.tag.len() + 1;
79+
let message_len = record.message.len() + 1;
8080
let mut buffer = bytes::BytesMut::with_capacity(12 + tag_len + message_len);
8181
let timestamp = record.timestamp.duration_since(UNIX_EPOCH).unwrap();
8282

0 commit comments

Comments
 (0)