summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 45e6e07..5ee9364 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -164,11 +164,9 @@ impl Pager {
}
/// Launch pager with the specified environment variables
- pub fn set_pager_envs(self, envs: &[&str]) -> Self {
- Self {
- envs: envs.into_iter().map(|x| x.into()).collect(),
- ..self
- }
+ pub fn pager_envs(self, envs: impl IntoIterator<Item = impl Into<OsString>>) -> Self {
+ let envs = envs.into_iter().map(|s| s.into()).collect();
+ Self { envs, ..self }
}
/// Instructs `Pager` to bypass invoking pager if output is not a `tty`