From the docs for std::print
:
Note that stdout is frequently line-buffered by default so it may be necessary to use io::stdout().flush() to ensure the output is emitted immediately.
So looks like you need to call io::stdout().flush()
.
More Related Contents:
- Traits and Rust
- Why do try!() and ? not compile when used in a function that doesn’t return Option or Result?
- How do I collect into an array?
- Can I do type introspection with trait objects and then downcast it?
- Cannot borrow as mutable more than once at a time in one code – but can in another very similar
- How can I perform parallel asynchronous HTTP GET requests with reqwest?
- Is it considered a bad practice to implement Deref for newtypes?
- Implementing a trait for multiple types at once
- Convert a String to int?
- How do I get an owned value out of a `Box`?
- Converting from Option to Option
- What is the difference between `e1` and `&e2` when used as the for-loop variable?
- Why doesn’t println! work in Rust unit tests?
- How do you use parent module imports in Rust?
- What does ‘let x = x’ do in Rust?
- How to take ownership of T from Arc?
- Is there any trait that specifies numeric functionality?
- How to use a local unpublished crate?
- Why do I get “type annotations needed” when using Iterator::collect?
- How can I create enums with constant values in Rust?
- How to embed resources in Rust executable?
- Sized is not implemented for the type Fn
- Extend lifetime of variable
- Can’t implement a trait I don’t own for all types that implement a trait I do own
- How do I print an integer in binary with leading zeros?
- What does Rust’s unary || (parallel pipe) mean?
- How does Rust’s type inference work across multiple statements?
- Why does Valgrind not detect a memory leak in a Rust program using nightly 1.29.0?
- What is the null pointer optimization in Rust?
- How to pass rustc flags to cargo?