Skip to content

Commit 9548d28

Browse files
committed
Remove deprecated
1 parent 1d327dd commit 9548d28

File tree

2 files changed

+2
-112
lines changed

2 files changed

+2
-112
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Unreleased
44

5+
- The deprecated `drop_left`, `drop_right`, `pad_left`, `pad_right`,
6+
`trim_left`, and `trim_right` functions have been removed.
57
- Fixed a bug that would result in `list.unique` having quadratic runtime.
68
- Fixed the implementation of `list.key_set` to be tail recursive.
79
- The `pop` and `pop_map` functions in the `list` module have been deprecated.

src/gleam/string.gleam

Lines changed: 0 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -222,20 +222,6 @@ fn do_slice(string: String, idx: Int, len: Int) -> String
222222
@external(javascript, "../gleam_stdlib.mjs", "crop_string")
223223
pub fn crop(from string: String, before substring: String) -> String
224224

225-
/// Drops *n* graphemes from the left side of a `String`.
226-
///
227-
/// ## Examples
228-
///
229-
/// ```gleam
230-
/// drop_left(from: "The Lone Gunmen", up_to: 2)
231-
/// // -> "e Lone Gunmen"
232-
/// ```
233-
///
234-
@deprecated("Use `string.drop_start` instead.")
235-
pub fn drop_left(from string: String, up_to num_graphemes: Int) -> String {
236-
drop_start(string, num_graphemes)
237-
}
238-
239225
/// Drops *n* graphemes from the start of a `String`.
240226
///
241227
/// ## Examples
@@ -256,20 +242,6 @@ pub fn drop_start(from string: String, up_to num_graphemes: Int) -> String {
256242
}
257243
}
258244

259-
/// Drops *n* graphemes from the right side of a `String`.
260-
///
261-
/// ## Examples
262-
///
263-
/// ```gleam
264-
/// drop_right(from: "Cigarette Smoking Man", up_to: 2)
265-
/// // -> "Cigarette Smoking M"
266-
/// ```
267-
///
268-
@deprecated("Use `string.drop_end` instead.")
269-
pub fn drop_right(from string: String, up_to num_graphemes: Int) -> String {
270-
drop_end(string, num_graphemes)
271-
}
272-
273245
/// Drops *n* graphemes from the end of a `String`.
274246
///
275247
/// ## Examples
@@ -464,34 +436,6 @@ pub fn join(strings: List(String), with separator: String) -> String {
464436
|> concat
465437
}
466438

467-
/// Pads a `String` on the left until it has at least given number of graphemes.
468-
///
469-
/// ## Examples
470-
///
471-
/// ```gleam
472-
/// pad_left("121", to: 5, with: ".")
473-
/// // -> "..121"
474-
/// ```
475-
///
476-
/// ```gleam
477-
/// pad_left("121", to: 3, with: ".")
478-
/// // -> "121"
479-
/// ```
480-
///
481-
/// ```gleam
482-
/// pad_left("121", to: 2, with: ".")
483-
/// // -> "121"
484-
/// ```
485-
///
486-
@deprecated("Use `string.pad_start` instead.")
487-
pub fn pad_left(
488-
string: String,
489-
to desired_length: Int,
490-
with pad_string: String,
491-
) -> String {
492-
pad_start(string, desired_length, pad_string)
493-
}
494-
495439
/// Pads the start of a `String` until it has a given length.
496440
///
497441
/// ## Examples
@@ -525,34 +469,6 @@ pub fn pad_start(
525469
}
526470
}
527471

528-
/// Pads a `String` on the right until it has a given length.
529-
///
530-
/// ## Examples
531-
///
532-
/// ```gleam
533-
/// pad_right("123", to: 5, with: ".")
534-
/// // -> "123.."
535-
/// ```
536-
///
537-
/// ```gleam
538-
/// pad_right("123", to: 3, with: ".")
539-
/// // -> "123"
540-
/// ```
541-
///
542-
/// ```gleam
543-
/// pad_right("123", to: 2, with: ".")
544-
/// // -> "123"
545-
/// ```
546-
///
547-
@deprecated("Use `string.pad_end` instead.")
548-
pub fn pad_right(
549-
string: String,
550-
to desired_length: Int,
551-
with pad_string: String,
552-
) -> String {
553-
pad_end(string, desired_length, pad_string)
554-
}
555-
556472
/// Pads the end of a `String` until it has a given length.
557473
///
558474
/// ## Examples
@@ -620,20 +536,6 @@ type Direction {
620536
Trailing
621537
}
622538

623-
/// Removes whitespace on the left of a `String`.
624-
///
625-
/// ## Examples
626-
///
627-
/// ```gleam
628-
/// trim_left(" hats \n")
629-
/// // -> "hats \n"
630-
/// ```
631-
///
632-
@deprecated("Use `string.trim_start` instead")
633-
pub fn trim_left(string: String) -> String {
634-
trim_start(string)
635-
}
636-
637539
/// Removes whitespace at the start of a `String`.
638540
///
639541
/// ## Examples
@@ -648,20 +550,6 @@ pub fn trim_start(string: String) -> String {
648550
erl_trim(string, Leading)
649551
}
650552

651-
/// Removes whitespace on the right of a `String`.
652-
///
653-
/// ## Examples
654-
///
655-
/// ```gleam
656-
/// trim_right(" hats \n")
657-
/// // -> " hats"
658-
/// ```
659-
///
660-
@deprecated("Use `string.trim_end` instead")
661-
pub fn trim_right(string: String) -> String {
662-
trim_end(string)
663-
}
664-
665553
/// Removes whitespace at the end of a `String`.
666554
///
667555
/// ## Examples

0 commit comments

Comments
 (0)