From 90168c5a412a69a34a156cca59fbde3d40893703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= Date: Thu, 6 Mar 2025 06:34:39 +0100 Subject: [PATCH] fixup! Polish documentation for the binary module --- lib/stdlib/src/binary.erl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/stdlib/src/binary.erl b/lib/stdlib/src/binary.erl index 65682e1d5cc..c2953be1a26 100644 --- a/lib/stdlib/src/binary.erl +++ b/lib/stdlib/src/binary.erl @@ -703,7 +703,7 @@ Summary of options: in the result. See the example below. - **trim** - Removes trailing empty parts of the result (as does `trim` in - `re:split/3`. + `re:split/3`). - **trim_all** - Removes all empty parts of the result. @@ -777,11 +777,12 @@ replace(H, N, R) -> end. -doc """ -Constructs a new binary by replacing the parts in `Subject` matching `Pattern` -with `Replacement` if given as a literal `t:binary/0` or with the result of -applying `Replacement` to a matching subpart if given as a `fun`. +Constructs a new binary by replacing the parts in `Subject` matching +`Pattern` with `Replacement` if given as a literal +[`binary()`](`t:binary/0`) or with the result of applying +`Replacement` to a matching subpart if given as a `fun`. -If `Replacement` is given as a `t:binary/0` and the matching subpart of +If `Replacement` is given as a [`binary()`](`t:binary/0`) and the matching subpart of `Subject` giving raise to the replacement is to be inserted in the result, option `{insert_replaced, InsPos}` inserts the matching part into `Replacement` at the specified position (or positions) before inserting `Replacement` into @@ -791,7 +792,7 @@ If any position specified in `InsPos` is greater than the size of the replacement binary, a `badarg` exception is raised. Options `global` and `{scope, part()}` work as for `split/3`. The return type is -always a `t:binary/0`. +always [`binary()`](`t:binary/0`). For a description of `Pattern`, see `compile_pattern/1`.