Skip to content

Commit 1b884f0

Browse files
diliopfacebook-github-bot
authored andcommitted
Update platform010 & platform010-aarch64 symlinks
Summary: Release notes: https://blog.rust-lang.org/2025/05/15/Rust-1.87.0/ Relevant changes: * `feature(extract_if)` stabilized * `feature(ptr_sub_ptr)` stabilized * `feature(os_str_display)` stabilized * `feature(slice_take)` stabilized * `feature(hash_raw_entry)` removed * `sub_ptr` renamed to `offset_from_unsigned` ([#137483](rust-lang/rust#137483)) * `MaybeUninit::uninit_array()` uses replaced with inline const blocks ([#125082](rust-lang/rust#125082)) * Lint `#[must_use`] attributes applied to methods in trait impls ([#136923](rust-lang/rust#136923)) * `clippy` lints: `io_other_error`, `elidable_lifetime_names`, `mem_replace_option_with_some`, `manual_contains`, `owned_cow` Reviewed By: dtolnay Differential Revision: D75010345 fbshipit-source-id: ab6ee65fe82eb7fe90b5aa9bbeeedefed2befad1
1 parent ccd0cf2 commit 1b884f0

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

eden/mononoke/gotham_ext/src/response/stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl<'a> CompressedResponseStream<'a> {
6868
// 2MiB, for LFS that's at least once every content chunk.
6969
const YIELD_EVERY: usize = 2 * 1024 * 1024;
7070

71-
let inner = inner.map_err(|e| io::Error::new(io::ErrorKind::Other, e));
71+
let inner = inner.map_err(io::Error::other);
7272
let inner = YieldStream::new(inner, YIELD_EVERY, |data| {
7373
data.as_ref().map_or(0, |b| b.len())
7474
});

eden/scm/lib/zstdelta/src/zstdelta.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ pub fn diff(base: &[u8], data: &[u8]) -> io::Result<Vec<u8>> {
8686
unsafe {
8787
let cctx = ZSTD_createCCtx();
8888
if cctx.is_null() {
89-
return Err(io::Error::new(io::ErrorKind::Other, "cannot create CCtx"));
89+
return Err(io::Error::other("cannot create CCtx"));
9090
}
9191

9292
let max_outsize = ZSTD_compressBound(data.len());
@@ -107,7 +107,7 @@ pub fn diff(base: &[u8], data: &[u8]) -> io::Result<Vec<u8>> {
107107

108108
if ZSTD_isError(outsize) != 0 {
109109
let msg = format!("cannot compress ({})", explain_error(outsize));
110-
Err(io::Error::new(io::ErrorKind::Other, msg))
110+
Err(io::Error::other(msg))
111111
} else {
112112
buf.set_len(outsize);
113113
Ok(buf)
@@ -120,18 +120,19 @@ pub fn apply(base: &[u8], delta: &[u8]) -> io::Result<Vec<u8>> {
120120
unsafe {
121121
let dctx = ZSTD_createDCtx();
122122
if dctx.is_null() {
123-
return Err(io::Error::new(io::ErrorKind::Other, "cannot create DCtx"));
123+
return Err(io::Error::other("cannot create DCtx"));
124124
}
125125
ZSTD_DCtx_setMaxWindowSize(dctx, 1 << ZSTD_WINDOWLOG_MAX);
126126

127127
let size = ZSTD_findDecompressedSize(delta.as_ptr() as *const c_void, delta.len()) as usize;
128128
if size == ZSTD_CONTENTSIZE_ERROR as usize || size == ZSTD_CONTENTSIZE_UNKNOWN as usize {
129129
ZSTD_freeDCtx(dctx);
130130
let msg = "cannot get decompress size";
131-
return Err(io::Error::new(io::ErrorKind::Other, msg));
131+
return Err(io::Error::other(msg));
132132
}
133133

134134
let mut buf: Vec<u8> = Vec::with_capacity(size);
135+
let _remaining = buf.spare_capacity_mut();
135136
buf.set_len(size);
136137

137138
let outsize = ZSTD_decompress_usingDict(
@@ -147,13 +148,13 @@ pub fn apply(base: &[u8], delta: &[u8]) -> io::Result<Vec<u8>> {
147148

148149
if ZSTD_isError(outsize) != 0 {
149150
let msg = format!("cannot decompress ({})", explain_error(outsize));
150-
Err(io::Error::new(io::ErrorKind::Other, msg))
151+
Err(io::Error::other(msg))
151152
} else if outsize != size {
152153
let msg = format!(
153154
"decompress size mismatch (expected {}, got {})",
154155
size, outsize
155156
);
156-
Err(io::Error::new(io::ErrorKind::Other, msg))
157+
Err(io::Error::other(msg))
157158
} else {
158159
Ok(buf)
159160
}

0 commit comments

Comments
 (0)