dune icon indicating copy to clipboard operation
dune copied to clipboard

Optimizations, correctly handle stdout

Open Aloso opened this issue 4 years ago • 1 comments

Fixes #71. Closes #70.

This PR adds a variable to the environment that tracks whether the currently evaluated expression's output should be printed directly or stored in a string. This is done to allow things like let x = which vim or "[" + (hostname ()) + "]".

I also refactored some parts to clone objects less often, allocate fewer Boxes and Vecs and use .to_string() instead of format!("{}", ..) when possible.

I replaced occurrences of impl ToString with impl Into<String> or just String, because ToString uses the Display implementation which might be more expensive.

Aloso avatar Oct 27 '21 21:10 Aloso

👀

cognivore avatar Aug 19 '24 10:08 cognivore