Skip to content

Commit d74160c

Browse files
committed
fix[display]: escape strings
Signed-off-by: Joe Isaacs <[email protected]>
1 parent 7e1d377 commit d74160c

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

vortex-dtype/src/field_names.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ impl<'de> serde::de::Deserialize<'de> for FieldName {
4242
}
4343

4444
impl fmt::Display for FieldName {
45+
#[expect(clippy::use_debug, reason = "Escape escape sequences")]
4546
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
46-
write!(f, "{}", self.0)
47+
write!(f, "{:?}", self.0)
4748
}
4849
}
4950

vortex-scalar/src/utf8.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// SPDX-License-Identifier: Apache-2.0
22
// SPDX-FileCopyrightText: Copyright the Vortex contributors
33

4+
use std::cmp;
5+
use std::fmt;
46
use std::fmt::Display;
57
use std::fmt::Formatter;
68
use std::sync::Arc;
@@ -30,10 +32,11 @@ pub struct Utf8Scalar<'a> {
3032
}
3133

3234
impl Display for Utf8Scalar<'_> {
33-
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
35+
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
36+
#[expect(clippy::use_debug, reason = "Escape escape sequences")]
3437
match &self.value {
3538
None => write!(f, "null"),
36-
Some(v) => write!(f, "\"{}\"", v.as_str()),
39+
Some(v) => write!(f, "\"{:?}\"", v.as_str()),
3740
}
3841
}
3942
}
@@ -45,13 +48,13 @@ impl PartialEq for Utf8Scalar<'_> {
4548
}
4649

4750
impl PartialOrd for Utf8Scalar<'_> {
48-
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
51+
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
4952
Some(self.cmp(other))
5053
}
5154
}
5255

5356
impl Ord for Utf8Scalar<'_> {
54-
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
57+
fn cmp(&self, other: &Self) -> cmp::Ordering {
5558
self.value.cmp(&other.value)
5659
}
5760
}

0 commit comments

Comments
 (0)