diff options
| author | KyleMiles <krm504@nyu.edu> | 2023-01-05 17:29:14 -0500 |
|---|---|---|
| committer | KyleMiles <krm504@nyu.edu> | 2023-01-06 16:29:58 -0500 |
| commit | a154e45cce79b0c2264c1e1cd37a3d1bf5bc6154 (patch) | |
| tree | 11f436b720edfdf37819e9e83e7131d220687074 /rust/src/downloadprovider.rs | |
| parent | 52edc39a7081fd6662e14fbcd473adabbbc36c7a (diff) | |
Rust API: Lots and lots of clippy changes
Diffstat (limited to 'rust/src/downloadprovider.rs')
| -rw-r--r-- | rust/src/downloadprovider.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/rust/src/downloadprovider.rs b/rust/src/downloadprovider.rs index 65a11dd0..dfc8b5e2 100644 --- a/rust/src/downloadprovider.rs +++ b/rust/src/downloadprovider.rs @@ -38,6 +38,8 @@ impl DownloadProvider { Ok(unsafe { Array::new(list, count, ()) }) } + /// TODO : Clippy isn't happy...says we should `impl Default`....excessive error checking might be preventing us from doing so + #[allow(clippy::should_implement_trait)] pub fn default() -> Result<DownloadProvider, ()> { let s = Settings::new(""); let dp_name = s.get_string("network.downloadProviderName", None, None); @@ -164,10 +166,10 @@ impl DownloadInstance { // Drop it unsafe { Box::from_raw(callbacks) }; if result < 0 { - return Err(self.get_error()); + Err(self.get_error()) + } else { + Ok(()) } - - return Ok(()); } unsafe extern "C" fn i_read_callback(data: *mut u8, len: u64, ctxt: *mut c_void) -> i64 { |
