Toot

Written by Jan :rust: :ferris: on 2025-01-19 at 19:55

Some #Rust string literal #trivia - the following are equal:

let s = "one line string";

let s = "one line \

         string";

And these ones are also equal:

let lines = "a\nmultiline\nstring";

let lines = "a

multiline

string";

and now my favorite... 🥁

let lines = "a\n\

         multiline\n\

         string";

Playground:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a2c5a0e080a4fc56bb9ea8accac22a8b

[#]RustLang #RustTips #Strings

=> More informations about this toot | View the thread | More toots from janriemer@floss.social

Mentions

Tags

=> View rust tag | View trivia tag | View rustlang tag | View rusttips tag | View strings tag

Proxy Information
Original URL
gemini://mastogem.picasoft.net/toot/113856774246752603
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
227.550613 milliseconds
Gemini-to-HTML Time
0.733998 milliseconds

This content has been proxied by September (3851b).