gix_quote/lib.rs
1//! Provides functions to quote and possibly unquote strings with different quoting styles.
2//!
3//! ## Examples
4//!
5//! ```
6//! use bstr::ByteSlice;
7//!
8//! let shell_argument = gix_quote::single("hello it's git!".into());
9//! assert_eq!(shell_argument, "'hello it'\\''s git'\\!''");
10//!
11//! let input = br#""line\nbreak""#.as_bstr();
12//! let (unquoted, consumed) = gix_quote::ansi_c::undo(input).unwrap();
13//! assert_eq!(unquoted.as_ref(), b"line\nbreak".as_bstr());
14//! assert_eq!(consumed, input.len());
15//! ```
16#![deny(rust_2018_idioms, missing_docs)]
17#![forbid(unsafe_code)]
18
19///
20pub mod ansi_c;
21
22mod single;
23pub use single::single;