File tree 4 files changed +7
-7
lines changed 4 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 2
2
Cargo.lock
3
3
* .swp
4
4
* ~
5
+ * .iml
Original file line number Diff line number Diff line change 1
1
use std:: collections:: HashMap ;
2
- use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
2
+ use std:: sync:: atomic:: { AtomicUsize , Ordering , ATOMIC_USIZE_INIT } ;
3
3
4
4
#[ derive( Debug ) ]
5
5
#[ derive( Clone ) ]
@@ -52,7 +52,7 @@ pub struct ObjectRef {
52
52
id : usize ,
53
53
}
54
54
55
- static current_ref_id : AtomicUsize = :: std :: sync :: atomic :: ATOMIC_USIZE_INIT ;
55
+ static CURRENT_REF_ID : AtomicUsize = ATOMIC_USIZE_INIT ;
56
56
57
57
#[ derive( Debug ) ]
58
58
pub struct ObjectStore {
@@ -65,7 +65,7 @@ impl ObjectStore {
65
65
}
66
66
67
67
pub fn allocate ( & mut self , obj : ObjectContent ) -> ObjectRef {
68
- let obj_ref = ObjectRef { id : current_ref_id . fetch_add ( 1 , Ordering :: SeqCst ) } ;
68
+ let obj_ref = ObjectRef { id : CURRENT_REF_ID . fetch_add ( 1 , Ordering :: SeqCst ) } ;
69
69
self . all_objects . insert ( obj_ref. clone ( ) , Object { content : obj } ) ;
70
70
obj_ref
71
71
}
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ impl<EP: EnvProxy> Processor<EP> {
86
86
let instructions: Vec < Instruction > = instructions:: InstructionDecoder :: new ( bytecode. iter ( ) ) . into_iter ( ) . collect ( ) ;
87
87
let mut program_counter = 0 as usize ;
88
88
let mut stack = VectorStack :: new ( ) ;
89
- while true {
89
+ loop {
90
90
let instruction = try!( instructions. get ( program_counter) . ok_or ( ProcessorError :: InvalidProgramCounter ) ) ;
91
91
program_counter += 1 ;
92
92
match * instruction {
Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ pub trait EnvProxy {
10
10
11
11
12
12
/// An EnvProxy that exposes the real environment
13
- pub struct RealEnvProxy {
14
- }
13
+ pub struct RealEnvProxy ;
15
14
16
15
impl RealEnvProxy {
17
16
pub fn new ( ) -> RealEnvProxy {
18
- RealEnvProxy { }
17
+ RealEnvProxy
19
18
}
20
19
}
21
20
You can’t perform that action at this time.
0 commit comments