Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2021-11-20
toolchain: nightly-2022-11-03
profile: minimal
components: rustfmt, clippy
override: true
Expand Down
7 changes: 3 additions & 4 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn main() {
let build_dir = &project_dir.join("randomx_build");

env::set_current_dir(Path::new(&repo_dir)).unwrap(); // change current path to repo for dependency build
match fs::create_dir_all(&build_dir) {
match fs::create_dir_all(build_dir) {
Ok(_) => (),
Err(e) => match e.kind() {
ErrorKind::AlreadyExists => (),
Expand Down Expand Up @@ -124,10 +124,9 @@ fn main() {
let android_sdk = env::var("ANDROID_SDK_ROOT").expect("ANDROID_SDK_ROOT variable not set");

let android_platform = env::var("ANDROID_PLATFORM").unwrap_or_else(|_| "android-26".to_owned());
let android_cmake =
env::var("ANDROID_CMAKE").unwrap_or(android_sdk.clone() + &"/cmake/3.22.1/bin/cmake".to_owned());
let android_cmake = env::var("ANDROID_CMAKE").unwrap_or(android_sdk.clone() + "/cmake/3.22.1/bin/cmake");
let android_toolchain = env::var("ANDROID_CMAKE_TOOLCHAIN")
.unwrap_or(android_sdk + &"/ndk/22.1.7171670/build/cmake/android.toolchain.cmake".to_owned());
.unwrap_or(android_sdk + "/ndk/22.1.7171670/build/cmake/android.toolchain.cmake");

let c = Command::new(android_cmake)
.arg("-D")
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# this should match the nightly version in tari-project/tari
# only used for cargo fmt settings, repo should always compile on stable too
[toolchain]
channel = "nightly-2021-11-20"
channel = "nightly-2022-11-03"
2 changes: 0 additions & 2 deletions rustfmt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ normalize_comments = true
reorder_imports = true
reorder_modules = true
reorder_impl_items = true
report_todo = "Never"
report_fixme = "Never"
space_after_colon = true
space_before_colon = false
struct_lit_single_line = true
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl RandomXCache {
let inner = RandomXCacheInner { cache_ptr: test };
let result = RandomXCache { inner: Arc::new(inner) };
let key_ptr = key.as_ptr() as *mut c_void;
let key_size = key.len() as usize;
let key_size = key.len();
unsafe {
randomx_init_cache(result.inner.cache_ptr, key_ptr, key_size);
}
Expand Down Expand Up @@ -262,7 +262,7 @@ impl RandomXDataset {
0 => Err(RandomXError::Other("Dataset item count was 0".to_string())),
x => {
// This weirdness brought to you by c_ulong being different on Windows and Linux
Ok(u32::try_from(u64::from(x))?)
Ok(u32::try_from(x)?)
},
}
}
Expand Down Expand Up @@ -392,7 +392,7 @@ impl RandomXVM {
if input.is_empty() {
Err(RandomXError::ParameterError("input was empty".to_string()))
} else {
let size_input = input.len() as usize;
let size_input = input.len();
let input_ptr = input.as_ptr() as *mut c_void;
let arr = [0; RANDOMX_HASH_SIZE as usize];
let output_ptr = arr.as_ptr() as *mut c_void;
Expand Down Expand Up @@ -450,7 +450,7 @@ impl RandomXVM {
}
return Err(RandomXError::ParameterError("input was empty".to_string()));
};
let size_input = input[i].len() as usize;
let size_input = input[i].len();
let input_ptr = input[i].as_ptr() as *mut c_void;
output_ptr = arr.as_ptr() as *mut c_void;
if i == 0 {
Expand Down