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

There should be a way to create non-constant @str values #3433

Closed
Dretch opened this issue Sep 9, 2012 · 4 comments
Closed

There should be a way to create non-constant @str values #3433

Dretch opened this issue Sep 9, 2012 · 4 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@Dretch
Copy link
Contributor

Dretch commented Sep 9, 2012

Currently you can only create constant values of @str, like @"abc".

There should be some way to turn &str and &u8 values (and therefore also ~str and ~[u8] values) into @str values.

@pcwalton
Copy link
Contributor

Possibly a ToManagedStr trait?

@Dretch
Copy link
Contributor Author

Dretch commented Sep 10, 2012

@pcwalton I have no objections to that. I would be happy even with just a method on &str, for now.

@graydon
Copy link
Contributor

graydon commented Sep 13, 2012

&str should carry methods that produce ~str and @str, yes. Doesn't need to be a separate general trait.

I think the ToStr trait should probably take a callback-taking-&str, not return ~str, fwiw. But when we have default methods the latter can be built on the former easily.

@Dretch
Copy link
Contributor Author

Dretch commented Apr 7, 2013

You can now do &str.to_managed() ... so this issue can be closed, thanks!

@Dretch Dretch closed this as completed Apr 7, 2013
RalfJung pushed a commit to RalfJung/rust that referenced this issue Mar 31, 2024
experiment with macOS M1 runners

Try running our macOS CI on the new free M1 runners. This would mean that our 3 jobs run 3 different OSes and 3 different host CPU architectures. :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants