summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril Plisko <cyril.plisko@mountall.com>2020-11-08 13:45:53 +0200
committerCyril Plisko <cyril.plisko@mountall.com>2020-11-08 13:45:53 +0200
commitfb5b45736c89296b50ef305a550d16fd7c022c87 (patch)
tree4a0e1ccc0e214564e83716e25005e4287ff3f3e8
parent1ff22a8fc392f9f01aca5cc3a9add09309e903c5 (diff)
Update Pager::pager_envs() signature
-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`