Skip to content
This repository was archived by the owner on Jun 10, 2024. It is now read-only.

Commit e9e0917

Browse files
committed
pid_to_process(Pid) -> pid_to_process(&Pid)
1 parent 1086514 commit e9e0917

File tree

9 files changed

+13
-13
lines changed

9 files changed

+13
-13
lines changed

lumen_runtime/src/otp/erlang/spawn_3/test/with_atom_module/with_atom_function/with_empty_list_arguments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn without_loaded_module_when_run_exits_undef() {
3434

3535
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
3636

37-
let arc_process = pid_to_process(child_pid_pid).unwrap();
37+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
3838

3939
assert!(arc_scheduler.run_through(&arc_process));
4040
assert!(!arc_scheduler.run_through(&arc_process));

lumen_runtime/src/otp/erlang/spawn_3/test/with_atom_module/with_atom_function/with_empty_list_arguments/with_loaded_module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ fn without_exported_function_when_run_exits_undef() {
3434

3535
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
3636

37-
let arc_process = pid_to_process(child_pid_pid).unwrap();
37+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
3838

3939
assert!(arc_scheduler.run_through(&arc_process));
4040
assert!(!arc_scheduler.run_through(&arc_process));

lumen_runtime/src/otp/erlang/spawn_3/test/with_atom_module/with_atom_function/with_empty_list_arguments/with_loaded_module/with_exported_function.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ fn with_arity_when_run_exits_normal() {
3131

3232
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
3333

34-
let arc_process = pid_to_process(child_pid_pid).unwrap();
34+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
3535

3636
assert!(arc_scheduler.run_through(&arc_process));
3737
assert!(!arc_scheduler.run_through(&arc_process));
@@ -79,7 +79,7 @@ fn without_arity_when_run_exits_undef() {
7979

8080
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
8181

82-
let arc_process = pid_to_process(child_pid_pid).unwrap();
82+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
8383

8484
assert!(arc_scheduler.run_through(&arc_process));
8585
assert!(!arc_scheduler.run_through(&arc_process));

lumen_runtime/src/otp/erlang/spawn_3/test/with_atom_module/with_atom_function/with_non_empty_proper_list_arguments.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ fn without_loaded_module_when_run_exits_undef() {
3636

3737
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
3838

39-
let arc_process = pid_to_process(child_pid_pid).unwrap();
39+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
4040

4141
assert!(arc_scheduler.run_through(&arc_process));
4242
assert!(!arc_scheduler.run_through(&arc_process));

lumen_runtime/src/otp/erlang/spawn_3/test/with_atom_module/with_atom_function/with_non_empty_proper_list_arguments/with_loaded_module.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fn without_exported_function_when_run_exits_undef() {
3737

3838
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
3939

40-
let arc_process = pid_to_process(child_pid_pid).unwrap();
40+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
4141

4242
assert!(arc_scheduler.run_through(&arc_process));
4343
assert!(!arc_scheduler.run_through(&arc_process));

lumen_runtime/src/otp/erlang/spawn_3/test/with_atom_module/with_atom_function/with_non_empty_proper_list_arguments/with_loaded_module/with_exported_function.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn without_arity_when_run_exits_undef() {
4040

4141
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
4242

43-
let arc_process = pid_to_process(child_pid_pid).unwrap();
43+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
4444

4545
assert!(arc_scheduler.run_through(&arc_process));
4646
assert!(!arc_scheduler.run_through(&arc_process));

lumen_runtime/src/otp/erlang/spawn_3/test/with_atom_module/with_atom_function/with_non_empty_proper_list_arguments/with_loaded_module/with_exported_function/with_arity.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn with_valid_arguments_when_run_exits_normal() {
3232

3333
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
3434

35-
let arc_process = pid_to_process(child_pid_pid).unwrap();
35+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
3636

3737
assert!(arc_scheduler.run_through(&arc_process));
3838
assert!(!arc_scheduler.run_through(&arc_process));
@@ -81,7 +81,7 @@ fn without_valid_arguments_when_run_exits() {
8181

8282
assert_eq!(run_queue_length_after, run_queue_length_before + 1);
8383

84-
let arc_process = pid_to_process(child_pid_pid).unwrap();
84+
let arc_process = pid_to_process(&child_pid_pid).unwrap();
8585

8686
assert!(arc_scheduler.run_through(&arc_process));
8787
assert!(!arc_scheduler.run_through(&arc_process));

lumen_runtime/src/registry.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ pub fn names(process_control_block: &ProcessControlBlock) -> exception::Result {
3434
Ok(acc)
3535
}
3636

37-
pub fn pid_to_process(pid: Pid) -> Option<Arc<ProcessControlBlock>> {
37+
pub fn pid_to_process(pid: &Pid) -> Option<Arc<ProcessControlBlock>> {
3838
RW_LOCK_WEAK_PROCESS_CONTROL_BLOCK_BY_PID
3939
.read()
40-
.get(&pid)
40+
.get(pid)
4141
.and_then(|weak_process| weak_process.clone().upgrade())
4242
}
4343

@@ -48,7 +48,7 @@ pub fn pid_to_self_or_process(
4848
if process_arc.pid() == pid {
4949
Some(process_arc.clone())
5050
} else {
51-
pid_to_process(pid)
51+
pid_to_process(&pid)
5252
}
5353
}
5454

lumen_runtime/src/send.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub fn send(
6565

6666
Ok(Sent::Sent)
6767
} else {
68-
match pid_to_process(destination_pid) {
68+
match pid_to_process(&destination_pid) {
6969
Some(destination_arc_process_control_block) => {
7070
if destination_arc_process_control_block.send_from_other(message)? {
7171
let scheduler_id = destination_arc_process_control_block

0 commit comments

Comments
 (0)