From 8bce7acd068432ab06d6162ecbf75776eb7b29d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Fri, 6 Sep 2024 12:07:40 +0200 Subject: [PATCH 1/2] Fix non-portable doc comments warning A line starting with > might be interpreted as a block quote. In regular markdown this could be prevented by escaping the `>` using a backslash. However, since the doc comments are used by clap for the long help more or less verbatim, the `\` would be visible hence the shuffling around of words. --- src/cli.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index fa635a756..011cdb56a 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -411,9 +411,9 @@ pub struct Opt { /// and line numbers link to the local file using a file URL, whereas commit hashes link to the /// commit in GitHub, if the remote repository is hosted by GitHub. See /// --hyperlinks-file-link-format for full control over the file URLs emitted. Hyperlinks are - /// supported by several common terminal emulators. To make them work, you must use less version - /// >= 581 with the -R flag (or use -r with older less versions, but this will break e.g. - /// --navigate). If you use tmux, then you will also need a patched fork of tmux (see + /// supported by several common terminal emulators. To make them work, you must use less + /// version >= 581 with the -R flag (or use -r with older less versions, but this will break + /// e.g. --navigate). If you use tmux, then you will also need a patched fork of tmux (see /// ). pub hyperlinks: bool, From 9bf90e540a8f9ca57e57c8d8a498902d96d78b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tau=20G=C3=A4rtli?= Date: Fri, 6 Sep 2024 12:09:29 +0200 Subject: [PATCH 2/2] Use `.contains()` --- src/utils/helpwrap.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/helpwrap.rs b/src/utils/helpwrap.rs index 24191d2b6..c091e32a7 100644 --- a/src/utils/helpwrap.rs +++ b/src/utils/helpwrap.rs @@ -103,7 +103,7 @@ pub fn wrap(text: &str, width: usize, indent_with: &str, no_indent: &str, no_wra } #[cfg(test)] - if result.find("no-sanity").is_none() { + if !result.contains("no-sanity") { // sanity check let stripped_input = text .replace(" ", "")