]> git.lizzy.rs Git - rust.git/commit
auto merge of #15353 : aturon/rust/env-hashmap, r=alexcrichton
authorbors <bors@rust-lang.org>
Thu, 10 Jul 2014 21:41:36 +0000 (21:41 +0000)
committerbors <bors@rust-lang.org>
Thu, 10 Jul 2014 21:41:36 +0000 (21:41 +0000)
commita672456c40d28f051ecbdb2caf5bf6733371d494
tree1ce9d7ff9d26425e9c581d7ce377531c1155da0b
parent8bbf598d50960087342667fc47f5d38f4a9c2165
parentbfa853f8ed45d1908c98ec350f52c7a6790661da
auto merge of #15353 : aturon/rust/env-hashmap, r=alexcrichton

This commit adds `env_insert` and `env_remove` methods to the `Command`
builder, easing updates to the environment variables for the child
process. The existing method, `env`, is still available for overriding
the entire environment in one shot (after which the `env_insert` and
`env_remove` methods can be used to make further adjustments).

To support these new methods, the internal `env` representation for
`Command` has been changed to an optional `HashMap` holding owned
`CString`s (to support non-utf8 data). The `HashMap` is only
materialized if the environment is updated. The implementation does not
try hard to avoid allocation, since the cost of launching a process will
dwarf any allocation cost.

This patch also adds `PartialOrd`, `Eq`, and `Hash` implementations for
`CString`.