Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String with truncating behavior #359

Open
lelongg opened this issue Mar 13, 2023 · 4 comments
Open

String with truncating behavior #359

lelongg opened this issue Mar 13, 2023 · 4 comments

Comments

@lelongg
Copy link

lelongg commented Mar 13, 2023

It might be desirable to have a string with truncation behavior when it is written beyond its capacity.

@reitermarkus
Copy link
Member

Can you clarify what the use case would look like for this?

@lelongg
Copy link
Author

lelongg commented Feb 5, 2024

A use case would be to have a non-panicking behavior when the string content is not vital, for logs for example. One might prefer to not have the full content and still carry on.

@newAM
Copy link
Member

newAM commented Feb 6, 2024

I agree not panicking is useful. I think we nay have fixed this since the issue was opened. Is this covered by the fix for #381?

I don't think we have any append or conversion methods in String that panic anymore, but I am on my phone so I haven't checked.

@lelongg
Copy link
Author

lelongg commented Feb 7, 2024

The particular use case I had was with the Write trait which can only panic on overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants