summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
authorCyril Plisko <cyril.plisko@mountall.com>2016-08-05 18:55:50 +0300
committerCyril Plisko <cyril.plisko@mountall.com>2016-08-05 18:55:50 +0300
commit8d6fcf247043ee5039e57401a8fdc78528d357f9 (patch)
treea6dbe3ed9438fdcecfe2d0d61b51b604cfed4582 /src/lib.rs
parent7b4976ac84bc1456d5d7f0b3b96c54c6b4b3325c (diff)
Make Pager::env() another form of constructor
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6f35829..b7b597d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -23,7 +23,7 @@
//! extern crate pager;
//! use pager::Pager;
//! fn main() {
-//! Pager::new().env("MY_PAGER").setup();
+//! Pager::env("MY_PAGER").setup();
//! // The rest of your program goes here
//! }
//! ```
@@ -56,9 +56,11 @@ impl Pager {
}
}
- pub fn env(&mut self, env: &str) -> &Self {
- self.env = String::from(env);
- self
+ pub fn env(env: &str) -> Self {
+ Pager {
+ env: String::from(env),
+ ok: true,
+ }
}
pub fn ok(&self) -> bool {