From b8f1048ce4bdf8552e0a18faa76feb79b038c7b7 Mon Sep 17 00:00:00 2001 From: Emmanuel Arrighi Date: Fri, 6 Feb 2026 16:43:11 +0100 Subject: [PATCH] CCString(cleanup): remove function always existing in stdlib > 4.08 --- src/core/CCString.ml | 13 ------------- src/core/CCString.mli | 16 +--------------- src/core/CCStringLabels.mli | 16 +--------------- 3 files changed, 2 insertions(+), 43 deletions(-) diff --git a/src/core/CCString.ml b/src/core/CCString.ml index ec87f351..9188b2a2 100644 --- a/src/core/CCString.ml +++ b/src/core/CCString.ml @@ -692,24 +692,11 @@ let of_gen g = let to_iter s k = String.iter k s -let rec _to_seq s i len () = - if len = 0 then - Seq.Nil - else - Seq.Cons (s.[i], _to_seq s (i + 1) (len - 1)) - -let to_seq s = _to_seq s 0 (String.length s) - let of_iter i = let b = Buffer.create 32 in i (Buffer.add_char b); Buffer.contents b -let of_seq seq = - let b = Buffer.create 32 in - Seq.iter (Buffer.add_char b) seq; - Buffer.contents b - let to_list s = _to_list s [] 0 (String.length s) let of_list l = diff --git a/src/core/CCString.mli b/src/core/CCString.mli index 9d2a66ee..daffcbdf 100644 --- a/src/core/CCString.mli +++ b/src/core/CCString.mli @@ -49,11 +49,6 @@ val to_iter : t -> char iter (** [to_iter s] returns the [iter] of characters contained in the string [s]. @since 2.8 *) -val to_seq : t -> char Seq.t -(** [to_seq s] returns the [Seq.t] of characters contained in the string [s]. - Renamed from [to std_seq] since 3.0. - @since 3.0 *) - val to_list : t -> char list (** [to_list s] returns the [list] of characters contained in the string [s]. *) @@ -98,11 +93,6 @@ val of_iter : char iter -> string (** [of_iter iter] converts an [iter] of characters to a string. @since 2.8 *) -val of_seq : char Seq.t -> string -(** [of_seq seq] converts a [seq] of characters to a string. - Renamed from [of_std_seq] since 3.0. - @since 3.0 *) - val of_list : char list -> string (** [of_list lc] converts a list of characters [lc] to a string. *) @@ -113,7 +103,7 @@ val to_array : string -> char array (** [to_array s] returns the array of characters contained in the string [s]. *) val find : ?start:int -> sub:string -> string -> int -(** [find ~start ~sub s] returns the starting index of the first occurrence of [sub] within [s] or [-1]. +(** [find ~start ~sub s] returns the starting index of the first occurrence of [sub] within [s] or [-1]. @param start starting position in [s]. *) val find_all : ?start:int -> sub:string -> string -> int gen @@ -472,10 +462,6 @@ module Split : sig @since 0.16 *) end -val split_on_char : char -> string -> string list -(** [split_on_char by s] splits the string [s] along the given char [by]. - @since 1.2 *) - val split : by:string -> string -> string list (** [split ~by s] splits the string [s] along the given string [by]. Alias to {!Split.list_cpy}. diff --git a/src/core/CCStringLabels.mli b/src/core/CCStringLabels.mli index 0bd3f1d7..d46a3222 100644 --- a/src/core/CCStringLabels.mli +++ b/src/core/CCStringLabels.mli @@ -49,11 +49,6 @@ val to_iter : t -> char iter (** [to_iter s] returns the [iter] of characters contained in the string [s]. @since 2.8 *) -val to_seq : t -> char Seq.t -(** [to_seq s] returns the [Seq.t] of characters contained in the string [s]. - Renamed from [to std_seq] since 3.0. - @since 3.0 *) - val to_list : t -> char list (** [to_list s] returns the [list] of characters contained in the string [s]. *) @@ -103,11 +98,6 @@ val of_iter : char iter -> string (** [of_iter iter] converts an [iter] of characters to a string. @since 2.8 *) -val of_seq : char Seq.t -> string -(** [of_seq seq] converts a [seq] of characters to a string. - Renamed from [of_std_seq] since 3.0. - @since 3.0 *) - val of_list : char list -> string (** [of_list lc] converts a list of characters [lc] to a string. *) @@ -118,7 +108,7 @@ val to_array : string -> char array (** [to_array s] returns the array of characters contained in the string [s]. *) val find : ?start:int -> sub:(string[@keep_label]) -> string -> int -(** [find ?start ~sub s] returns the starting index of the first occurrence of [sub] within [s] or [-1]. +(** [find ?start ~sub s] returns the starting index of the first occurrence of [sub] within [s] or [-1]. @param start starting position in [s]. *) val find_all : ?start:int -> sub:(string[@keep_label]) -> string -> int gen @@ -512,10 +502,6 @@ module Split : sig @since 0.16 *) end -val split_on_char : by:char -> string -> string list -(** [split_on_char ~by s] splits the string [s] along the given char [by]. - @since 1.2 *) - val split : by:(string[@keep_label]) -> string -> string list (** [split ~by s] splits the string [s] along the given string [by]. Alias to {!Split.list_cpy}.