Skip to content

Commit efed6a3

Browse files
committed
Merge remote-tracking branch 'tpt/master'
Conflicts: src/objects/mod.rs src/processor/instructions.rs src/processor/mod.rs
2 parents 3dfa6e7 + 95ac7ea commit efed6a3

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ target
22
Cargo.lock
33
*.swp
44
*~
5+
*.iml

src/objects/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::collections::HashMap;
2-
use std::sync::atomic::{AtomicUsize, Ordering};
2+
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
33

44
#[derive(Debug)]
55
#[derive(Clone)]
@@ -52,7 +52,7 @@ pub struct ObjectRef {
5252
id: usize,
5353
}
5454

55-
static current_ref_id: AtomicUsize = ::std::sync::atomic::ATOMIC_USIZE_INIT;
55+
static CURRENT_REF_ID: AtomicUsize = ATOMIC_USIZE_INIT;
5656

5757
#[derive(Debug)]
5858
pub struct ObjectStore {
@@ -65,7 +65,7 @@ impl ObjectStore {
6565
}
6666

6767
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) };
6969
self.all_objects.insert(obj_ref.clone(), Object { content: obj });
7070
obj_ref
7171
}

src/processor/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<EP: EnvProxy> Processor<EP> {
8686
let instructions: Vec<Instruction> = instructions::InstructionDecoder::new(bytecode.iter()).into_iter().collect();
8787
let mut program_counter = 0 as usize;
8888
let mut stack = VectorStack::new();
89-
while true {
89+
loop {
9090
let instruction = try!(instructions.get(program_counter).ok_or(ProcessorError::InvalidProgramCounter));
9191
program_counter += 1;
9292
match *instruction {

src/sandbox/mod.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ pub trait EnvProxy {
1010

1111

1212
/// An EnvProxy that exposes the real environment
13-
pub struct RealEnvProxy {
14-
}
13+
pub struct RealEnvProxy;
1514

1615
impl RealEnvProxy {
1716
pub fn new() -> RealEnvProxy {
18-
RealEnvProxy { }
17+
RealEnvProxy
1918
}
2019
}
2120

0 commit comments

Comments
 (0)