Skip to content

Commit d731a1c

Browse files
committed
doc: Clarify description of single escaping
This improves how `gix_quote::single` documents how it handles the cases it treats specially. The fix in #717 (discussed in #713) wasn't accompanied by a change to the documentation, which continued either to describe the preceding behavior or to be ambiguous. This changes it to describe the current behavior unambiguously. Only documentation is changed.
1 parent 810b5cf commit d731a1c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gix-quote/src/single.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use bstr::{BStr, BString, ByteSlice, ByteVec};
22

33
/// Transforms the given `value` to be suitable for use as an argument for Bourne shells by wrapping it into single quotes.
44
///
5-
/// Every single-quote `'` is escaped with `\'`, every exclamation mark `!` is escaped with `\!`, and the entire string is enclosed
6-
/// in single quotes.
5+
/// Every single-quote `'` is escaped as `'\''`, every exclamation mark `!` is escaped as `'\!'`,
6+
/// and the entire string is enclosed in single quotes.
77
pub fn single(mut value: &BStr) -> BString {
88
let mut quoted = BString::new(b"'".to_vec());
99

0 commit comments

Comments
 (0)