Skip to content

Commit 35ab437

Browse files
committed
impl fmt::Display for StrView
1 parent dcaf265 commit 35ab437

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "byteview"
33
description = "Thin, immutable zero-copy slice type"
44
license = "MIT OR Apache-2.0"
5-
version = "0.4.1"
5+
version = "0.5.0"
66
edition = "2021"
77
rust-version = "1.74"
88
readme = "README.md"

src/strview.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ unsafe impl Send for StrView {}
2323
#[allow(clippy::non_send_fields_in_send_ty)]
2424
unsafe impl Sync for StrView {}
2525

26+
impl std::fmt::Display for StrView {
27+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
28+
write!(f, "{}", &**self)
29+
}
30+
}
31+
2632
impl std::fmt::Debug for StrView {
2733
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2834
write!(f, "{:?}", &**self)

0 commit comments

Comments
 (0)