summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyril Plisko <cyril.plisko@mountall.com>2017-07-05 20:42:04 +0300
committerCyril Plisko <cyril.plisko@mountall.com>2017-07-05 20:44:55 +0300
commit798decbf7470673296d14171dad42af76fa08905 (patch)
tree947c683cc2ecd2a7bdc45fbc8286e86a7475cd5f
parent4ab2de40b12e1e6c84a540a9838a6f7af57a1fe3 (diff)
Introduce with_env() and deprecate env()
-rw-r--r--src/lib.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 563658e..121ba22 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -25,7 +25,7 @@
//! extern crate pager;
//! use pager::Pager;
//! fn main() {
-//! Pager::env("MY_PAGER").setup();
+//! Pager::with_env("MY_PAGER").setup();
//! // The rest of your program goes here
//! }
//! ```
@@ -72,11 +72,11 @@ pub struct Pager {
impl Pager {
/// Creates new instance of pager with default settings
pub fn new() -> Self {
- Pager::env(DEFAULT_PAGER_ENV)
+ Pager::with_env(DEFAULT_PAGER_ENV)
}
/// Creates new instance of pager using `env` environment variable instead of PAGER
- pub fn env(env: &str) -> Self {
+ pub fn with_env(env: &str) -> Self {
let pager = utils::find_pager(env);
Pager {
@@ -86,6 +86,11 @@ impl Pager {
}
}
+ #[deprecated(since = "0.12.0", note = "use with_env() instead")]
+ pub fn env(env: &str) -> Self {
+ Pager::with_env(env)
+ }
+
/// Creates a new pager instance directly specifying the desired pager
pub fn with_pager(pager: &str) -> Self {
Pager {