diff --git a/src/bash.rs b/src/bash.rs index e407d97..e019fa3 100644 --- a/src/bash.rs +++ b/src/bash.rs @@ -72,20 +72,20 @@ pub struct Bash; // ---------------------------------------------------------------------------- impl QuoteInto> for Bash { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut Vec) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut Vec) { Self::quote_into_vec(s, out); } } impl QuoteInto for Bash { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut String) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut String) { Self::quote_into_vec(s, unsafe { out.as_mut_vec() }) } } #[cfg(unix)] impl QuoteInto for Bash { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut std::ffi::OsString) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut std::ffi::OsString) { use std::os::unix::ffi::OsStringExt; let s = Self::quote_vec(s); let s = std::ffi::OsString::from_vec(s); @@ -95,7 +95,7 @@ impl QuoteInto for Bash { #[cfg(feature = "bstr")] impl QuoteInto for Bash { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut bstr::BString) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut bstr::BString) { let s = Self::quote_vec(s); out.extend(s); } diff --git a/src/fish.rs b/src/fish.rs index 58b9012..a791f4b 100644 --- a/src/fish.rs +++ b/src/fish.rs @@ -24,20 +24,20 @@ use crate::{ascii::Char, util::u8_to_hex_escape_uppercase_x, Quotable, QuoteInto pub struct Fish; impl QuoteInto> for Fish { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut Vec) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut Vec) { Self::quote_into_vec(s, out); } } impl QuoteInto for Fish { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut String) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut String) { Self::quote_into_vec(s, unsafe { out.as_mut_vec() }) } } #[cfg(unix)] impl QuoteInto for Fish { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut std::ffi::OsString) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut std::ffi::OsString) { use std::os::unix::ffi::OsStringExt; let s = Self::quote_vec(s); let s = std::ffi::OsString::from_vec(s); @@ -47,7 +47,7 @@ impl QuoteInto for Fish { #[cfg(feature = "bstr")] impl QuoteInto for Fish { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut bstr::BString) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut bstr::BString) { let s = Self::quote_vec(s); out.extend(s); } diff --git a/src/lib.rs b/src/lib.rs index a79c341..8e1936c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,15 +39,15 @@ pub type Zsh = bash::Bash; /// Quoting/escaping a string of bytes into a shell-safe form. pub trait QuoteInto { /// Quote/escape a string of bytes into an existing container. - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut OUT); + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut OUT); } /// Quoting/escaping a string of bytes into a shell-safe form. pub trait Quote: QuoteInto { /// Quote/escape a string of bytes into a new container. - fn x_quote<'q, S: ?Sized + Into>>(s: S) -> OUT { + fn quote<'q, S: ?Sized + Into>>(s: S) -> OUT { let mut out = OUT::default(); - Self::x_quote_into(s, &mut out); + Self::quote_into(s, &mut out); out } } @@ -73,7 +73,7 @@ impl QuoteExt for T { Q: QuoteInto, S: ?Sized + Into>, { - Q::x_quote_into(s, self); + Q::quote_into(s, self); } } @@ -92,7 +92,7 @@ where S: ?Sized + Into>, { fn quoted>(self, _q: Q) -> OUT { - Q::x_quote(self) + Q::quote(self) } } diff --git a/src/sh.rs b/src/sh.rs index d13fd09..d04bdbf 100644 --- a/src/sh.rs +++ b/src/sh.rs @@ -81,14 +81,14 @@ use crate::{ascii::Char, Quotable, QuoteInto}; pub struct Sh; impl QuoteInto> for Sh { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut Vec) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut Vec) { Self::quote_into_vec(s, out); } } #[cfg(unix)] impl QuoteInto for Sh { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut std::ffi::OsString) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut std::ffi::OsString) { use std::os::unix::ffi::OsStringExt; let s = Self::quote_vec(s); let s = std::ffi::OsString::from_vec(s); @@ -98,7 +98,7 @@ impl QuoteInto for Sh { #[cfg(feature = "bstr")] impl QuoteInto for Sh { - fn x_quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut bstr::BString) { + fn quote_into<'q, S: ?Sized + Into>>(s: S, out: &mut bstr::BString) { let s = Self::quote_vec(s); out.extend(s); }