-
Notifications
You must be signed in to change notification settings - Fork 13.3k
add puts() to libstd and the prelude #9361
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
Conversation
@@ -39,7 +39,7 @@ pub use option::{Option, Some, None}; | |||
pub use result::{Result, Ok, Err}; | |||
|
|||
// Reexported functions | |||
pub use io::{print, println}; | |||
pub use io::{print, println,puts}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be , puts
with a space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, I'll fix it ;)
Hi, thanks for the PR, but I think there are a few problems:
In summary, if this was rewritten to use the |
hmm ok, so I'll rewrite this (shouldn't be a lot of work) and we'll see ;) I wanted to create some sort of shortcut for printing an object, without the |
@flo-l There might be a different way to do this than requiring a new function. The following code works today:
However, |
Also, there are vague plans to make it so that writing The point is, we feel your pain. :) |
ok, this sounds great ;) but I'm afraid I don't know enough about the new string formatting system, can you give me a hint where I have to look for information? |
Don't lint `needless_return` if `return` has attrs Fixes rust-lang#9361 The lint used to have a mechanic to allow `cfg`-attrs on naked `return`-statements. This was well-intentioned, yet we can have any kind of attribute, e.g. `allow`, `expect` or even custom `derive`. So the mechanic was simply removed. We now never lint on a naked `return`-statement that has attributes on it. Turns out that the ui-test had a Catch22 in it: In `check_expect()` the `#[expect(clippy::needless_return)]` is an attribute on the `return` statement that can and will be rustfixed away without side effects. But any other attribute would also have been removed, which is what rust-lang#9361 is about. The test proved the wrong thing. Removed the test, the body is tested elsewhere as well. changelog: Ignore [`needless_return`] on `return`s with attrs
I don't know if you want this function in the stdlib, but in my opinion it's a very useful little helper! ;)
It works, as stated in the code, like the
puts
method in ruby, except for the fact that it only takes one object as parameter and not a variable number of objects.