From 9ce4b2ff4a8781ec5f496c5282e20c99345de67d Mon Sep 17 00:00:00 2001 From: Malo <57839069+MDLC01@users.noreply.github.com> Date: Wed, 25 Dec 2024 16:45:34 +0100 Subject: [PATCH] Improve documentation --- crates/typst-library/src/foundations/array.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/crates/typst-library/src/foundations/array.rs b/crates/typst-library/src/foundations/array.rs index 97e403841..a420ae186 100644 --- a/crates/typst-library/src/foundations/array.rs +++ b/crates/typst-library/src/foundations/array.rs @@ -838,14 +838,16 @@ impl Array { /// The callsite span. span: Span, /// If given, applies this function to the elements in the array to - /// determine the keys to sort by. + /// determine the keys to sort by. Mutually exclusive with `compare`. #[named] key: Option, /// If given, uses this function to compare elements in the array. + /// Mutually exclusive with `key`. /// - /// This function should return an integer, whose sign is - /// used to determine the relative order of two given - /// elements. + /// This function should return an integer, whose sign is used to + /// determine the relative order of two given elements: Negative if the + /// first element is smaller, positive if the second element is smaller. + /// If `{0}` is returned, the order of the elements is not modified. #[named] compare: Option, ) -> SourceResult {