Skip to content

Commit 5da9aca

Browse files
authored
called cargo fmt (#200)
1 parent 9b3a9ce commit 5da9aca

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

program/rust/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
22
println!("cargo:rustc-link-search=../c/target");
3-
}
3+
}

program/rust/src/lib.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
mod c_oracle_header;
44
mod time_machine_types;
55

6-
//do not link with C during unit tests (which are built in native architecture, unlike libpyth.o)
6+
//do not link with C during unit tests (which are built in native architecture, unlike libpyth.o)
77
#[cfg(target_arch = "bpf")]
88
#[link(name = "cpyth")]
99
extern "C" {
@@ -12,18 +12,17 @@ extern "C" {
1212

1313
//make the C entrypoint a no-op when running cargo test
1414
#[cfg(not(target_arch = "bpf"))]
15-
pub extern "C" fn c_entrypoint(input: *mut u8) -> u64{
16-
0//SUCCESS value
15+
pub extern "C" fn c_entrypoint(input: *mut u8) -> u64 {
16+
0 //SUCCESS value
1717
}
1818

19-
2019
#[no_mangle]
2120
pub extern "C" fn entrypoint(input: *mut u8) -> u64 {
22-
let c_ret_val = unsafe{c_entrypoint(input)};
23-
if c_ret_val == c_oracle_header::SUCCESSFULLY_UPDATED_AGGREGATE{
21+
let c_ret_val = unsafe { c_entrypoint(input) };
22+
if c_ret_val == c_oracle_header::SUCCESSFULLY_UPDATED_AGGREGATE {
2423
//0 is the SUCCESS value for solana
2524
return 0;
2625
} else {
2726
return c_ret_val;
2827
}
29-
}
28+
}
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use super::c_oracle_header;
22
#[derive(Debug, Clone)]
33
#[repr(C)]
4-
/// this wraps multiple SMA and tick trackers, and includes all the state
5-
/// used by the time machine
6-
pub struct TimeMachineWrapper{
4+
/// this wraps multiple SMA and tick trackers, and includes all the state
5+
/// used by the time machine
6+
pub struct TimeMachineWrapper {
77
//Place holder with the size of the fields I am planning to add
8-
place_holder: [u8;1864],
8+
place_holder: [u8; 1864],
99
}
1010

1111
#[test]
@@ -17,4 +17,4 @@ fn c_time_machine_size_is_correct() {
1717
c_oracle_header::TIME_MACHINE_STRUCT_SIZE.try_into().unwrap(),
1818
"expected TIME_MACHINE_STRUCT_SIZE in oracle.h to the same as the size of TimeMachineWrapper"
1919
);
20-
}
20+
}

0 commit comments

Comments
 (0)