Skip to content
This repository was archived by the owner on May 9, 2022. It is now read-only.

Commit 28a4907

Browse files
longtomjrPiDelport
authored andcommitted
style(exec_enclave): fix clippy lint errors on sample functions
1 parent ad18b3f commit 28a4907

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

rtc_exec_enclave/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct Token {
2323
binary_hash: [u8; 32],
2424
}
2525

26-
pub unsafe fn request_execution(token: Token, _params: ()) -> Result<Box<[u8]>, ()> {
26+
pub fn request_execution(token: Token, _params: ()) -> Result<Box<[u8]>, ()> {
2727
let exec_module = match get_module_by_id(token.binary_hash) {
2828
Some(val) => val,
2929
None => return Err(()),
@@ -47,7 +47,7 @@ pub unsafe fn request_execution(token: Token, _params: ()) -> Result<Box<[u8]>,
4747
// XXX: This is placeholder until we completed the data retrieval flow and know what values
4848
// we need to pass through to the data enclave
4949
fn get_data(_token: &Token) -> Box<[u8]> {
50-
return vec![123; 43].into_boxed_slice();
50+
vec![123; 43].into_boxed_slice()
5151
}
5252

5353
// XXX: The implementation is only for the sample functions currently

rtc_exec_enclave/src/sample_functions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ fn median(data: &mut [f64]) -> Option<f64> {
6565

6666
fn mean(data: &mut [f64]) -> Option<f64> {
6767
// If len is 0 we cannot calculate a mean
68-
if data.len() == 0 {
68+
if data.is_empty() {
6969
None
7070
} else {
7171
let sum: f64 = data.iter().sum();

0 commit comments

Comments
 (0)