Skip to content

Commit ffe8198

Browse files
Remove OwnedLiteral and SharedLiteral
From my GitHub searches and from looking at reverse dependencies, it seems like no one is using these. Further, it seems weird to have these type declarations for `Literal` but not for any other specific `*Lit` types. Very often, specific types are used. Removing these slightly reduces the API area, helping with learnability.
1 parent 4fde9a0 commit ffe8198

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/lib.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -157,17 +157,10 @@ pub use self::{
157157
// ===== `Literal` and type defs
158158
// ==============================================================================================
159159

160-
/// A literal which owns the underlying buffer.
161-
pub type OwnedLiteral = Literal<String>;
162-
163-
/// A literal whose underlying buffer is borrowed.
164-
pub type SharedLiteral<'a> = Literal<&'a str>;
165-
166160
/// A literal. This is the main type of this library.
167161
///
168162
/// This type is generic over the underlying buffer `B`, which can be `&str` or
169-
/// `String`. There are two useful type aliases: [`OwnedLiteral`] and
170-
/// [`SharedLiteral`].
163+
/// `String`.
171164
///
172165
/// To create this type, you have to either call [`Literal::parse`] with an
173166
/// input string or use the `From<_>` impls of this type. The impls are only
@@ -243,7 +236,7 @@ impl<B: Buffer> Literal<B> {
243236
impl Literal<&str> {
244237
/// Makes a copy of the underlying buffer and returns the owned version of
245238
/// `Self`.
246-
pub fn into_owned(self) -> OwnedLiteral {
239+
pub fn into_owned(self) -> Literal<String> {
247240
match self {
248241
Literal::Bool(l) => Literal::Bool(l.to_owned()),
249242
Literal::Integer(l) => Literal::Integer(l.to_owned()),

0 commit comments

Comments
 (0)