Skip to content

Commit 637ec11

Browse files
Fix docs.rs onig_sys build error:
oniguruma/src/st.c:500:23: error: too many arguments to function 'func'; expected 0, have 3
1 parent d8ea483 commit 637ec11

File tree

7 files changed

+14
-25
lines changed

7 files changed

+14
-25
lines changed

Cargo.lock

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+5
Original file line numberDiff line numberDiff line change
@@ -141,3 +141,8 @@ harness = false
141141
name = "cratesfyi"
142142
test = false
143143
doc = false
144+
145+
[patch.crates-io.onig_sys]
146+
# Once new version (> 69.8.1) is released, we can remove this patch.
147+
git = "https://github.com/rust-onig/rust-onig"
148+
rev = "c4378abcbf30d58cf5f230c0d2e6375f2be05a47"

build.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ mod tracked {
55
use once_cell::sync::Lazy;
66
use std::{
77
collections::HashSet,
8-
io::{Error, ErrorKind, Result},
8+
io::{Error, Result},
99
path::{Path, PathBuf},
1010
sync::Mutex,
1111
};
@@ -21,10 +21,7 @@ mod tracked {
2121
if !seen.contains(path) {
2222
seen.insert(path.to_owned());
2323
let path = path.to_str().ok_or_else(|| {
24-
Error::new(
25-
ErrorKind::Other,
26-
format!("{} is a non-utf-8 path", path.display()),
27-
)
24+
Error::other(format!("{} is a non-utf-8 path", path.display()))
2825
})?;
2926
println!("cargo:rerun-if-changed={path}");
3027
}

src/storage/database.rs

+2-10
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ impl DatabaseBackend {
8080
let result = if let Some(r) = range {
8181
// when we only want to get a range we can validate already if the range is small enough
8282
if (r.end() - r.start() + 1) > max_size as u64 {
83-
return Err(std::io::Error::new(
84-
std::io::ErrorKind::Other,
85-
crate::error::SizeLimitReached,
86-
)
87-
.into());
83+
return Err(std::io::Error::other(crate::error::SizeLimitReached).into());
8884
}
8985
let range_start = i32::try_from(*r.start())?;
9086

@@ -123,11 +119,7 @@ impl DatabaseBackend {
123119
};
124120

125121
if result.is_too_big {
126-
return Err(std::io::Error::new(
127-
std::io::ErrorKind::Other,
128-
crate::error::SizeLimitReached,
129-
)
130-
.into());
122+
return Err(std::io::Error::other(crate::error::SizeLimitReached).into());
131123
}
132124

133125
let compression = result.compression.map(|i| {

src/storage/s3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ where
5252
Ok(result) => Ok(result),
5353
Err(err) => {
5454
if let Some(err_code) = err.code() {
55-
if NOT_FOUND_ERROR_CODES.iter().any(|&code| err_code == code) {
55+
if NOT_FOUND_ERROR_CODES.contains(&err_code) {
5656
return Err(super::PathNotFoundError.into());
5757
}
5858
}

src/utils/sized_buffer.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use std::io::{Error as IoError, ErrorKind, Write};
1+
use std::io::{Error as IoError, Write};
22

33
pub(crate) struct SizedBuffer {
44
inner: Vec<u8>,
@@ -29,10 +29,7 @@ impl SizedBuffer {
2929
impl Write for SizedBuffer {
3030
fn write(&mut self, buf: &[u8]) -> Result<usize, IoError> {
3131
if self.inner.len() + buf.len() > self.limit {
32-
Err(IoError::new(
33-
ErrorKind::Other,
34-
crate::error::SizeLimitReached,
35-
))
32+
Err(IoError::other(crate::error::SizeLimitReached))
3633
} else {
3734
self.inner.write(buf)
3835
}

src/web/crate_details.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -1993,8 +1993,7 @@ mod tests {
19931993
.expect("invalid selector")
19941994
.map(|el| {
19951995
let attributes = el.attributes.borrow();
1996-
let url = attributes.get("href").expect("href").to_string();
1997-
url
1996+
attributes.get("href").expect("href").to_string()
19981997
})
19991998
.collect();
20001999

0 commit comments

Comments
 (0)