Skip to content

Commit 2f1b5ac

Browse files
authored
chore(clippy): fix new clippy errors
* chore(clippy): fix new clippy errors * chore: update embed base image and bindings Refs: #558
1 parent b9728f4 commit 2f1b5ac

File tree

6 files changed

+45
-21
lines changed

6 files changed

+45
-21
lines changed

.github/actions/embed/Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
FROM php:8.2-bullseye
1+
FROM debian:trixie
22

33
WORKDIR /tmp
44

55
RUN apt update -y && apt upgrade -y
6-
RUN apt install lsb-release wget gnupg software-properties-common -y
6+
RUN apt install lsb-release wget gnupg php8.4-dev libphp8.4-embed build-essential curl -y
77
RUN bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)"
88

99
ENV RUSTUP_HOME=/rust
@@ -12,4 +12,4 @@ ENV PATH=/cargo/bin:/rust/bin:$PATH
1212

1313
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path && cargo install cargo-expand
1414

15-
ENTRYPOINT [ "/cargo/bin/cargo", "test", "--all", "--release", "--all-features", "--no-fail-fast" ]
15+
ENTRYPOINT [ "/cargo/bin/cargo", "test", "--workspace", "--release", "--all-features", "--no-fail-fast" ]

build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ fn find_php() -> Result<PathBuf> {
7474
if let Some(path) = path_from_env("PHP") {
7575
if !path.try_exists()? {
7676
// If path was explicitly given and it can't be found, this is a hard error
77-
bail!("php executable not found at {:?}", path);
77+
bail!("php executable not found at {}", path.display());
7878
}
7979
return Ok(path);
8080
}

crates/cli/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -269,15 +269,15 @@ fn get_ext_dir() -> AResult<PathBuf> {
269269
.output()
270270
.context("Failed to call PHP")?;
271271
if !cmd.status.success() {
272-
bail!("Failed to call PHP: {:?}", cmd);
272+
bail!("Failed to call PHP: {cmd:?}");
273273
}
274274
let stdout = String::from_utf8_lossy(&cmd.stdout);
275275
let ext_dir = PathBuf::from(stdout.rsplit('\n').next().unwrap());
276276
if !ext_dir.is_dir() {
277277
if ext_dir.exists() {
278278
bail!(
279-
"Extension directory returned from PHP is not a valid directory: {:?}",
280-
ext_dir
279+
"Extension directory returned from PHP is not a valid directory: {}",
280+
ext_dir.display()
281281
);
282282
}
283283

@@ -299,14 +299,14 @@ fn get_php_ini() -> AResult<PathBuf> {
299299
.output()
300300
.context("Failed to call PHP")?;
301301
if !cmd.status.success() {
302-
bail!("Failed to call PHP: {:?}", cmd);
302+
bail!("Failed to call PHP: {cmd:?}");
303303
}
304304
let stdout = String::from_utf8_lossy(&cmd.stdout);
305305
let ini = PathBuf::from(stdout.rsplit('\n').next().unwrap());
306306
if !ini.is_file() {
307307
bail!(
308-
"php.ini does not exist or is not a file at the given path: {:?}",
309-
ini
308+
"php.ini does not exist or is not a file at the given path: {}",
309+
ini.display()
310310
);
311311
}
312312
Ok(ini)
@@ -416,7 +416,7 @@ impl Stubs {
416416
})?;
417417

418418
if !cli_version.matches(&ext_version) {
419-
bail!("Extension was compiled with an incompatible version of `ext-php-rs` - Extension: {}, CLI: {}", ext_version, cli_version);
419+
bail!("Extension was compiled with an incompatible version of `ext-php-rs` - Extension: {ext_version}, CLI: {cli_version}");
420420
}
421421

422422
let stubs = result

docsrs_bindings.rs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,9 @@ pub struct _IO_FILE {
260260
pub _markers: *mut _IO_marker,
261261
pub _chain: *mut _IO_FILE,
262262
pub _fileno: ::std::os::raw::c_int,
263-
pub _flags2: ::std::os::raw::c_int,
263+
pub _bitfield_align_1: [u32; 0],
264+
pub _bitfield_1: __BindgenBitfieldUnit<[u8; 3usize]>,
265+
pub _short_backupbuf: [::std::os::raw::c_char; 1usize],
264266
pub _old_offset: __off_t,
265267
pub _cur_column: ::std::os::raw::c_ushort,
266268
pub _vtable_offset: ::std::os::raw::c_schar,
@@ -271,10 +273,32 @@ pub struct _IO_FILE {
271273
pub _wide_data: *mut _IO_wide_data,
272274
pub _freeres_list: *mut _IO_FILE,
273275
pub _freeres_buf: *mut ::std::os::raw::c_void,
274-
pub __pad5: usize,
276+
pub _prevchain: *mut *mut _IO_FILE,
275277
pub _mode: ::std::os::raw::c_int,
276278
pub _unused2: [::std::os::raw::c_char; 20usize],
277279
}
280+
impl _IO_FILE {
281+
#[inline]
282+
pub fn _flags2(&self) -> ::std::os::raw::c_int {
283+
unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 24u8) as u32) }
284+
}
285+
#[inline]
286+
pub fn set__flags2(&mut self, val: ::std::os::raw::c_int) {
287+
unsafe {
288+
let val: u32 = ::std::mem::transmute(val);
289+
self._bitfield_1.set(0usize, 24u8, val as u64)
290+
}
291+
}
292+
#[inline]
293+
pub fn new_bitfield_1(_flags2: ::std::os::raw::c_int) -> __BindgenBitfieldUnit<[u8; 3usize]> {
294+
let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 3usize]> = Default::default();
295+
__bindgen_bitfield_unit.set(0usize, 24u8, {
296+
let _flags2: u32 = unsafe { ::std::mem::transmute(_flags2) };
297+
_flags2 as u64
298+
});
299+
__bindgen_bitfield_unit
300+
}
301+
}
278302
pub type zend_long = i64;
279303
pub type zend_ulong = u64;
280304
pub type zend_off_t = i64;

flake.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unix_build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Provider<'_> {
1818
let stdout = String::from_utf8_lossy(&cmd.stdout);
1919
if !cmd.status.success() {
2020
let stderr = String::from_utf8_lossy(&cmd.stderr);
21-
bail!("Failed to run `php-config`: {} {}", stdout, stderr);
21+
bail!("Failed to run `php-config`: {stdout} {stderr}");
2222
}
2323
Ok(stdout.to_string())
2424
}
@@ -28,7 +28,7 @@ impl Provider<'_> {
2828
if let Some(path) = path_from_env("PHP_CONFIG") {
2929
if !path.try_exists()? {
3030
// If path was explicitly given and it can't be found, this is a hard error
31-
bail!("php-config executable not found at {:?}", path);
31+
bail!("php-config executable not found at {}", path.display());
3232
}
3333
return Ok(path);
3434
}

0 commit comments

Comments
 (0)