File tree 1 file changed +20
-2
lines changed
1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -336,15 +336,33 @@ pub trait Integer: Sized + Num + PartialOrd + Ord + Eq {
336
336
self . clone ( ) - self . mod_floor ( other)
337
337
}
338
338
339
- /// Decrements self.
339
+ /// Decrements self by one.
340
+ ///
341
+ /// # Examples
342
+ ///
343
+ /// ~~~
344
+ /// # use num_integer::Integer;
345
+ /// let mut x: i32 = 43;
346
+ /// x.dec();
347
+ /// assert_eq!(x, 42);
348
+ /// ~~~
340
349
fn dec ( & mut self )
341
350
where
342
351
Self : Clone ,
343
352
{
344
353
* self = self . clone ( ) - Self :: one ( )
345
354
}
346
355
347
- /// Increments self.
356
+ /// Increments self by one.
357
+ ///
358
+ /// # Examples
359
+ ///
360
+ /// ~~~
361
+ /// # use num_integer::Integer;
362
+ /// let mut x: i32 = 41;
363
+ /// x.inc();
364
+ /// assert_eq!(x, 42);
365
+ /// ~~~
348
366
fn inc ( & mut self )
349
367
where
350
368
Self : Clone ,
You can’t perform that action at this time.
0 commit comments