-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cairo v2.6.3
- Loading branch information
Showing
30 changed files
with
1,332 additions
and
775 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ edition = "2023_11" | |
|
||
[config.global.experimental_features] | ||
negative_impls = true | ||
coupons = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,44 @@ | ||
/// Minimum of the two values. | ||
/// # Arguments | ||
/// * `a` - first comparable value | ||
/// * `b` - Second comparable value | ||
/// # Returns | ||
/// * `result` - The smallest of the two values | ||
#[must_use] | ||
pub fn min<T, +PartialOrd<T>, +Drop<T>, +Copy<T>>(a: T, b: T) -> T { | ||
if a > b { | ||
return b; | ||
b | ||
} else { | ||
a | ||
} | ||
a | ||
} | ||
|
||
/// Maximum of the two values. | ||
/// # Arguments | ||
/// * `a` - first comparable value | ||
/// * `b` - Second comparable value | ||
/// # Returns | ||
/// * `result` - The greatest of the two values | ||
#[must_use] | ||
pub fn max<T, +PartialOrd<T>, +Drop<T>, +Copy<T>>(a: T, b: T) -> T { | ||
if a > b { | ||
return a; | ||
a | ||
} else { | ||
b | ||
} | ||
} | ||
|
||
/// Minimum and maximum of the two values. | ||
/// # Arguments | ||
/// * `a` - first comparable value | ||
/// * `b` - Second comparable value | ||
/// # Returns | ||
/// * `result` - The two values sorted in ascending order | ||
#[must_use] | ||
pub fn minmax<T, +PartialOrd<T>, +Drop<T>, +Copy<T>>(a: T, b: T) -> (T, T) { | ||
if a > b { | ||
(b, a) | ||
} else { | ||
(a, b) | ||
} | ||
b | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.