Skip to content

Commit 3b17305

Browse files
committed
doc: Fix description of gix_testtools::Env::unset
The `unset` method inadvertently had the same docstring as `set`, even though this was not correct for `unset`. This fixes that, and also rewords the `Env` docstring to better account for the ability to unset.
1 parent ec0d03a commit 3b17305

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/tools/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ fn family_name() -> &'static str {
824824
}
825825
}
826826

827-
/// A utility to set environment variables, while unsetting them (or resetting them to their previous value) on drop.
827+
/// A utility to set and unset environment variables, while restoring or removing them on drop.
828828
#[derive(Default)]
829829
pub struct Env<'a> {
830830
altered_vars: Vec<(&'a str, Option<OsString>)>,
@@ -846,7 +846,7 @@ impl<'a> Env<'a> {
846846
self
847847
}
848848

849-
/// Set `var` to `value`.
849+
/// Unset `var`.
850850
pub fn unset(mut self, var: &'a str) -> Self {
851851
let prev = std::env::var_os(var);
852852
std::env::remove_var(var);

0 commit comments

Comments
 (0)