diff --git a/src/lib.rs b/src/lib.rs index ff5d38c..a2a2e0f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -246,11 +246,25 @@ pub trait Casing> { /// ``` fn with_boundaries(&self, bs: &[Boundary]) -> StateConverter; + /// Creates a `StateConverter` struct initialized without the boundaries + /// provided. + /// ``` + /// use convert_case::{Boundary, Case, Casing}; + /// + /// assert_eq!( + /// "2d_transformation", + /// "2dTransformation" + /// .without_boundaries(&Boundary::digits()) + /// .to_case(Case::Snake) + /// ); + /// ``` + fn without_boundaries(&self, bs: &[Boundary]) -> StateConverter; + /// Determines if `self` is of the given case. This is done simply by applying /// the conversion and seeing if the result is the same. /// ``` /// use convert_case::{Case, Casing}; - /// + /// /// assert!( "kebab-case-string".is_case(Case::Kebab)); /// assert!( "Train-Case-String".is_case(Case::Train)); /// @@ -272,6 +286,10 @@ where StateConverter::new(self).with_boundaries(bs) } + fn without_boundaries(&self, bs: &[Boundary]) -> StateConverter { + StateConverter::new(self).without_boundaries(bs) + } + fn from_case(&self, case: Case) -> StateConverter { StateConverter::new_from_case(self, case) }