You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use pretty to print text that comes from users. The problem is that it will contain new lines. What would be the preferred way of using it here? Should I simply break up the string myself on newlines and add each seperately with Doc::text?
The text was updated successfully, but these errors were encountered:
You can use https://docs.rs/pretty/0.11.3/pretty/trait.DocAllocator.html#method.reflow if you are fine with treating newlines the same as any whitespace. Otherwise you will need to break it up yourself as Doc::text will treat newlines the same as any other character so it tends to mess up the width calculation.
I would like to use
pretty
to print text that comes from users. The problem is that it will contain new lines. What would be the preferred way of using it here? Should I simply break up the string myself on newlines and add each seperately withDoc::text
?The text was updated successfully, but these errors were encountered: