Dangling reference to intermediate value

The reference is pointing to the static memory, it's not dangling.

You can learn more by reading a similar question from another user asked just a few days ago: &str is same with slice?.