on master help sign in
pager.rs: Some comment fixups
commitdd6f57e1073100ab0f85f272177efe9568550940 authorMartin Nordholts <enselic@gmail.com> dateSun 10 Jan 2021, 13:25 (6 years ago) parentdfe7a60
2 files changed+7−7
src/pager.rs+6−6 tests/integration_tests.rs+1−1
src/pager.rs+6−6
@@ -20,7 +20,7 @@ pub(crate) enum PagerSource {
2020/// We know about some pagers, for example 'less'. This is a list of all pagers we know about
2121#[derive(Debug, PartialEq)]
2222pub(crate) enum PagerKind {
23− /// The pager is ourselves
23+ /// bat
2424 Bat,
2525
2626 /// less
@@ -62,16 +62,16 @@ impl PagerKind {
6262/// A pager such as 'less', and from where we got it.
6363#[derive(Debug)]
6464pub(crate) struct Pager {
65− // The pager binary
65+ /// The pager binary
6666 pub bin: String,
6767
68− // The pager binary arguments (that we might tweak)
68+ /// The pager binary arguments (that we might tweak)
6969 pub args: Vec<String>,
7070
71− // What pager this is
71+ /// What pager this is
7272 pub kind: PagerKind,
7373
74− // From where this pager comes
74+ /// From where this pager comes
7575 pub source: PagerSource,
7676}
7777
@@ -103,7 +103,7 @@ pub(crate) fn get_pager(config_pager: Option<&str>) -> Result<Option<Pager>, Par
103103 Some((bin, args)) => {
104104 let kind = PagerKind::from_bin(bin);
105105
106− // 'more' and 'most' does not supports colors; automatically use 'less' instead
106+ // 'more' and 'most' do not supports colors; automatically use 'less' instead
107107 // if the problematic pager came from the generic PAGER env var
108108 let no_color_support = kind == PagerKind::More || kind == PagerKind::Most;
109109 let use_less_instead = no_color_support && source == PagerSource::EnvVarPager;
tests/integration_tests.rs+1−1
@@ -91,7 +91,7 @@ fn restore_path(original_path: String) {
9191fn with_mocked_versions_of_more_and_most_in_path(actual_test: fn()) {
9292 let original_path = prepend_dir_to_path_env_var(get_mocked_pagers_dir());
9393
94− // Make sure our own variants of 'more' and 'most' is used
94+ // Make sure our own variants of 'more' and 'most' are used
9595 Command::new(mocked_pager("more"))
9696 .assert()
9797 .success()