mirror of
https://github.com/servo/servo.git
synced 2025-08-04 21:20:23 +01:00
clippy: fix result_unit_err
warnings (#31791)
* clippy: fix `result_unit_err` warnings * feat: fix result warnings in script * doc: document `generate_key` return type Co-authored-by: Martin Robinson <mrobinson@igalia.com> * feat: add back result to RangeRequestBounds::get_final Co-authored-by: Martin Robinson <mrobinson@igalia.com> --------- Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
ea62a5e24f
commit
da696b7e57
14 changed files with 175 additions and 191 deletions
|
@ -293,12 +293,9 @@ impl FileManager {
|
|||
let file_impl = self.store.get_impl(id, file_token, origin_in)?;
|
||||
match file_impl {
|
||||
FileImpl::Memory(buf) => {
|
||||
let range = match range.get_final(Some(buf.size)) {
|
||||
Ok(range) => range,
|
||||
Err(_) => {
|
||||
return Err(BlobURLStoreError::InvalidRange);
|
||||
},
|
||||
};
|
||||
let range = range
|
||||
.get_final(Some(buf.size))
|
||||
.map_err(|_| BlobURLStoreError::InvalidRange)?;
|
||||
|
||||
let range = range.to_abs_range(buf.size as usize);
|
||||
let len = range.len() as u64;
|
||||
|
@ -328,12 +325,9 @@ impl FileManager {
|
|||
let file = File::open(&metadata.path)
|
||||
.map_err(|e| BlobURLStoreError::External(e.to_string()))?;
|
||||
|
||||
let range = match range.get_final(Some(metadata.size)) {
|
||||
Ok(range) => range,
|
||||
Err(_) => {
|
||||
return Err(BlobURLStoreError::InvalidRange);
|
||||
},
|
||||
};
|
||||
let range = range
|
||||
.get_final(Some(metadata.size))
|
||||
.map_err(|_| BlobURLStoreError::InvalidRange)?;
|
||||
|
||||
let mut reader = BufReader::with_capacity(FILE_CHUNK_SIZE, file);
|
||||
if reader.seek(SeekFrom::Start(range.start as u64)).is_err() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue