Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
OpenByteDev committed Aug 13, 2023
1 parent 0c2e22c commit 7c227d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/hostfxr/library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use std::{

pub(crate) type HostfxrLibrary = Container<crate::bindings::hostfxr::wrapper_option::Hostfxr>;
pub(crate) type SharedHostfxrLibrary = Rc<HostfxrLibrary>;
pub(crate) const UNSUPPORTED_HOST_VERSION_ERROR_CODE: i32 = HostingError::HostApiUnsupportedVersion.value() as i32;
#[allow(clippy::cast_possible_wrap)]
pub(crate) const UNSUPPORTED_HOST_VERSION_ERROR_CODE: i32 =
HostingError::HostApiUnsupportedVersion.value() as i32;

/// A struct representing a loaded hostfxr library.
#[derive(Clone, From)]
Expand Down
3 changes: 2 additions & 1 deletion src/hostfxr/library2_1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ impl Hostfxr {
buffer.spare_capacity_mut().len().try_into().unwrap(),
&mut required_buffer_size,
)
}.unwrap_or_else(|| HostingError::HostApiUnsupportedVersion.value() as i32);
}
.unwrap_or(UNSUPPORTED_HOST_VERSION_ERROR_CODE);
HostingResult::from(result).into_result()?;
unsafe { buffer.set_len(required_buffer_size.try_into().unwrap()) };

Expand Down

0 comments on commit 7c227d5

Please sign in to comment.