Skip to content

Feature Request: A string! macro for declaring new Owned Strings from parameter. #14688

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

Closed
WebeWizard opened this issue Jun 6, 2014 · 3 comments

Comments

@WebeWizard
Copy link
Contributor

I think it would make a good sibling to vec! . I say so because I'd like consistency when declaring new vector based types. Also, stringify! returns a string slice.
let mystring: String = My String".to_string(); is reasonable, but to my knowledge there is no [ 1 , 2 , 3 ].to_vec()

@WebeWizard WebeWizard reopened this Jun 6, 2014
@japaric
Copy link
Member

japaric commented Nov 6, 2014

This doesn't seem relevant anymore (perhaps this was opened when we were in the ~str -> String flux?). Today you can create String/Vec in several ways:

[1, 2, 3].to_vec!() == vec![1, 2, 3];
format!("Hello") == "Hello".to_string();

I think this should be closed.

cc @alexcrichton

@japaric
Copy link
Member

japaric commented Nov 6, 2014

Or in any case, adding a new macro to stdlib should go through the RFC processs

@WebeWizard
Copy link
Contributor Author

I'll close it. Thanks.

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
…raw-strings, r=Veykril

fix: ide: do not highlight escapes in raw strings

fixes rust-lang#14688
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

No branches or pull requests

2 participants