File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -843,7 +843,7 @@ fn tls_rng_state(_v: @@mut IsaacRng) {}
843843 * `task_rng().gen::<int>()`.
844844 */
845845#[ inline]
846- pub fn task_rng( ) -> @@ mut IsaacRng {
846+ pub fn task_rng( ) -> @mut IsaacRng {
847847 let r : Option <@@mut IsaacRng >;
848848 unsafe {
849849 r = local_data : : local_data_get( tls_rng_state) ;
@@ -853,20 +853,18 @@ pub fn task_rng() -> @@mut IsaacRng {
853853 unsafe {
854854 let rng = @@mut IsaacRng :: new_seeded( seed( ) ) ;
855855 local_data:: local_data_set( tls_rng_state, rng) ;
856- rng
856+ * rng
857857 }
858858 }
859- Some ( rng) => rng
859+ Some ( rng) => * rng
860860 }
861861}
862862
863863// Allow direct chaining with `task_rng`
864- impl <R : Rng > Rng for @@ mut R {
864+ impl <R : Rng > Rng for @mut R {
865865 #[ inline]
866866 fn next( & mut self ) -> u32 {
867- match * self {
868- @@ref mut r => r. next( )
869- }
867+ ( * * self ) . next( )
870868 }
871869}
872870
@@ -876,9 +874,7 @@ impl<R: Rng> Rng for @@mut R {
876874 */
877875#[ inline]
878876pub fn random< T : Rand > ( ) -> T {
879- match * task_rng( ) {
880- @ref mut r => r. gen ( )
881- }
877+ task_rng( ) . gen ( )
882878}
883879
884880#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments