File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed
Expand file tree Collapse file tree 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 {
336336 self . clone ( ) - self . mod_floor ( other)
337337 }
338338
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+ /// ~~~
340349 fn dec ( & mut self )
341350 where
342351 Self : Clone ,
343352 {
344353 * self = self . clone ( ) - Self :: one ( )
345354 }
346355
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+ /// ~~~
348366 fn inc ( & mut self )
349367 where
350368 Self : Clone ,
You can’t perform that action at this time.
0 commit comments