auto merge of #16233 : omasanori/rust/abs_sub, r=steveklabnik
Use proper argument names and unbackquote the word "zero" because it is not an identifier.
This commit is contained in:
commit
765a23f73d
1 changed files with 2 additions and 2 deletions
|
@ -279,8 +279,8 @@ pub fn abs<T: Signed>(value: T) -> T {
|
|||
|
||||
/// The positive difference of two numbers.
|
||||
///
|
||||
/// Returns `zero` if the number is less than or equal to `other`,
|
||||
/// otherwise the difference between `self` and `other` is returned.
|
||||
/// Returns zero if `x` is less than or equal to `y`, otherwise the difference
|
||||
/// between `x` and `y` is returned.
|
||||
#[inline(always)]
|
||||
pub fn abs_sub<T: Signed>(x: T, y: T) -> T {
|
||||
x.abs_sub(&y)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue