From 16ccc1d2c47b31ce9c26566f1e37082ddce2c144 Mon Sep 17 00:00:00 2001 From: +merlan #flirora Date: Mon, 4 Nov 2024 15:31:25 -0500 Subject: [PATCH] Revise doc comments --- crates/typst-library/src/foundations/array.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/typst-library/src/foundations/array.rs b/crates/typst-library/src/foundations/array.rs index 3412056a8..8ce3b09a9 100644 --- a/crates/typst-library/src/foundations/array.rs +++ b/crates/typst-library/src/foundations/array.rs @@ -814,7 +814,7 @@ impl Array { /// function. The sorting algorithm used is stable. /// /// Returns an error if two values could not be compared or if the key - /// function (if given) yields an error. + /// or comparison function (if given) yields an error. /// /// To sort according to multiple criteria at once, e.g. in case of equality /// between some criteria, the key function can return an array. The results @@ -841,8 +841,11 @@ impl Array { /// determine the keys to sort by. #[named] key: Option, - /// If given, uses this function to compare elements in the array to - /// determine their relative order. + /// If given, uses this function to compare elements in the array. + /// + /// This function should return an integer, whose sign is + /// used to determine the relative order of two given + /// elements. #[named] compare: Option, ) -> SourceResult {