Skip to content

Tee: add AsRef<str>, Display and from_str implementation#86

Merged
Xynnn007 merged 1 commit into
confidential-containers:mainfrom
Xynnn007:tee-to-string
May 12, 2026
Merged

Tee: add AsRef<str>, Display and from_str implementation#86
Xynnn007 merged 1 commit into
confidential-containers:mainfrom
Xynnn007:tee-to-string

Conversation

@Xynnn007

Copy link
Copy Markdown
Member

Tee enum now can only be serde/deserde via serde-rs. In this way there will always be " around the serde-ed string, and always require " for the string to be de-serde.

The patch helps to natively support ToString and FromString like traits.

@Xynnn007 Xynnn007 requested a review from a team as a code owner May 11, 2026 12:06
@fitzthum

Copy link
Copy Markdown
Member

Tests sad.

This will help us remove a couple places where we have to strip out the quotes from the serde deserialized string.

@Xynnn007

Copy link
Copy Markdown
Member Author

@fitzthum fixed

@mythi

mythi commented May 12, 2026

Copy link
Copy Markdown
Collaborator

Did you consider using strum macros since this crate already pulls it?

@Xynnn007

Copy link
Copy Markdown
Member Author

Oh I did not realize this is already imported so chose to impl it without importing more deps. Let me do a refactoring.

Tee enum now can only be serde/deserde via serde-rs. In this way there
will always be `"` around the serde-ed string, and always require `"`
for the string to be de-serde.

The patch helps to natively support ToString and FromString like traits
using strum crate.

Signed-off-by: Xynnn007 <xynnn@linux.alibaba.com>

@mythi mythi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Xynnn007 Xynnn007 merged commit 0130f5d into confidential-containers:main May 12, 2026
3 checks passed
@Xynnn007 Xynnn007 deleted the tee-to-string branch May 12, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants