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 @@ -844,7 +844,7 @@ fn tls_rng_state(_v: @@mut IsaacRng) {}
844844 * `task_rng().gen::<int>()`.
845845 */
846846#[ inline]
847- pub fn task_rng( ) -> @@ mut IsaacRng {
847+ pub fn task_rng( ) -> @mut IsaacRng {
848848 let r : Option <@@mut IsaacRng >;
849849 unsafe {
850850 r = local_data : : local_data_get( tls_rng_state) ;
@@ -854,20 +854,18 @@ pub fn task_rng() -> @@mut IsaacRng {
854854 unsafe {
855855 let rng = @@mut IsaacRng :: new_seeded( seed( ) ) ;
856856 local_data:: local_data_set( tls_rng_state, rng) ;
857- rng
857+ * rng
858858 }
859859 }
860- Some ( rng) => rng
860+ Some ( rng) => * rng
861861 }
862862}
863863
864864// Allow direct chaining with `task_rng`
865- impl <R : Rng > Rng for @@ mut R {
865+ impl <R : Rng > Rng for @mut R {
866866 #[ inline]
867867 fn next( & mut self ) -> u32 {
868- match * self {
869- @@ref mut r => r. next( )
870- }
868+ ( * * self ) . next( )
871869 }
872870}
873871
@@ -877,9 +875,7 @@ impl<R: Rng> Rng for @@mut R {
877875 */
878876#[ inline]
879877pub fn random< T : Rand > ( ) -> T {
880- match * task_rng( ) {
881- @ref mut r => r. gen ( )
882- }
878+ task_rng( ) . gen ( )
883879}
884880
885881#[ cfg( test) ]
You can’t perform that action at this time.
0 commit comments