mirror of
https://github.com/typst/typst
synced 2025-08-14 15:17:57 +08:00
Improve documentation
This commit is contained in:
parent
0aa385d584
commit
9ce4b2ff4a
@ -838,14 +838,16 @@ impl Array {
|
|||||||
/// The callsite span.
|
/// The callsite span.
|
||||||
span: Span,
|
span: Span,
|
||||||
/// If given, applies this function to the elements in the array to
|
/// 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]
|
#[named]
|
||||||
key: Option<Func>,
|
key: Option<Func>,
|
||||||
/// If given, uses this function to compare elements in the array.
|
/// If given, uses this function to compare elements in the array.
|
||||||
|
/// Mutually exclusive with `key`.
|
||||||
///
|
///
|
||||||
/// This function should return an integer, whose sign is
|
/// This function should return an integer, whose sign is used to
|
||||||
/// used to determine the relative order of two given
|
/// determine the relative order of two given elements: Negative if the
|
||||||
/// elements.
|
/// first element is smaller, positive if the second element is smaller.
|
||||||
|
/// If `{0}` is returned, the order of the elements is not modified.
|
||||||
#[named]
|
#[named]
|
||||||
compare: Option<Func>,
|
compare: Option<Func>,
|
||||||
) -> SourceResult<Array> {
|
) -> SourceResult<Array> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user