Skip to content

Conversation

@Aloso
Copy link
Contributor

@Aloso Aloso commented Oct 27, 2021

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.

@cognivore
Copy link

👀

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

Successfully merging this pull request may close these issues.

Storing output of commands doesn't work Using backtick

2 participants