Skip to content

Commit c73b7f7

Browse files
morrisonlevibwoebirealFlowControl
authored
style: cargo clippy --fix and fmt on Rust v1.84 (#3032)
* style: cargo clippy --fix and fmt on Rust v1.84 * ci: ping kong/hhtpbin * fix windows version CRLF --------- Signed-off-by: Bob Weinand <[email protected]> Co-authored-by: Bob Weinand <[email protected]> Co-authored-by: Florian Engelhardt <[email protected]>
1 parent a6ad4f5 commit c73b7f7

File tree

10 files changed

+20
-19
lines changed

10 files changed

+20
-19
lines changed

.circleci/continue_config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ aliases:
4040
- ES_JAVA_OPTS=-Xms1g -Xmx1g
4141

4242
- &IMAGE_DOCKER_HTTPBIN
43-
image: kong/httpbin
43+
image: kong/httpbin:0.2.2
4444
name: httpbin_integration
4545

4646
- &IMAGE_DOCKER_KAFKA
@@ -548,7 +548,7 @@ commands:
548548
-v $(pwd)/tests/snapshots:/snapshots \
549549
--name test-agent ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:latest
550550
retry_docker run --detach --rm --net net \
551-
--name httpbin_integration kong/httpbin
551+
--name httpbin_integration kong/httpbin:0.2.2
552552
retry_docker run --detach --rm --net net \
553553
-e DD_REQUEST_DUMPER_FILE=dump.json \
554554
--name request-replayer datadog/dd-trace-ci:php-request-replayer-2.0

config.w32

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ if (PHP_DDTRACE != 'no') {
88

99
var versionpath = configure_module_dirname + "/ext/version.h";
1010
var versionfile = FSO.CreateTextFile(versionpath, true);
11+
var versionContent = FSO.OpenTextFile(configure_module_dirname + "/VERSION", 1).ReadAll();
12+
versionContent = versionContent.replace(/[\r\n]+$/, '');
1113
versionfile.WriteLine("#ifndef PHP_DDTRACE_VERSION");
12-
versionfile.WriteLine('#define PHP_DDTRACE_VERSION "' + FSO.OpenTextFile(configure_module_dirname + "/VERSION", 1).ReadAll() + '"');
14+
versionfile.WriteLine('#define PHP_DDTRACE_VERSION "' + versionContent + '"');
1315
versionfile.WriteLine("#endif");
1416
versionfile.Close();
1517

docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ services:
215215
image: "memcached:1.5-alpine"
216216

217217
httpbin_integration:
218-
image: kong/httpbin
218+
image: kong/httpbin:0.2.2
219219
ports:
220220
- "8765:80"
221221

profiling/src/allocation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ use log::{debug, error, trace, warn};
1010
use rand::rngs::ThreadRng;
1111
use rand_distr::{Distribution, Poisson};
1212
use std::cell::{RefCell, UnsafeCell};
13+
use std::ptr;
1314
use std::sync::atomic::AtomicU64;
1415
use std::sync::atomic::Ordering::{Relaxed, SeqCst};
15-
use std::{ffi, ptr};
1616

1717
static mut GC_MEM_CACHES_HANDLER: zend::InternalFunctionHandler = None;
1818

@@ -318,7 +318,7 @@ pub fn alloc_prof_rshutdown() {
318318
pub fn alloc_prof_startup() {
319319
unsafe {
320320
let handle = datadog_php_zif_handler::new(
321-
ffi::CStr::from_bytes_with_nul_unchecked(b"gc_mem_caches\0"),
321+
c"gc_mem_caches",
322322
ptr::addr_of_mut!(GC_MEM_CACHES_HANDLER),
323323
Some(alloc_prof_gc_mem_caches),
324324
);

profiling/src/bindings/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ impl<'a> From<&'a str> for ZaiStr<'a> {
568568
}
569569
}
570570

571-
impl<'a> Default for ZaiStr<'a> {
571+
impl Default for ZaiStr<'_> {
572572
fn default() -> Self {
573573
Self::new()
574574
}

profiling/src/exception.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use crate::REQUEST_LOCALS;
44
use log::{error, info};
55
use rand::rngs::ThreadRng;
66
use std::cell::RefCell;
7-
use std::ffi::CStr;
87
use std::ptr;
98
use std::sync::atomic::AtomicU32;
109
use std::sync::atomic::Ordering;
@@ -136,8 +135,8 @@ pub fn exception_profiling_minit() {
136135
zend::zend_throw_exception_hook = Some(exception_profiling_throw_exception_hook);
137136

138137
let method_handlers = [zend::datadog_php_zim_handler::new(
139-
CStr::from_bytes_with_nul_unchecked(b"generator\0"),
140-
CStr::from_bytes_with_nul_unchecked(b"throw\0"),
138+
c"generator",
139+
c"throw",
141140
ptr::addr_of_mut!(GENERATOR_THROW_HANDLER),
142141
Some(ddog_php_prof_generator_throw),
143142
)];

profiling/src/profiling/stack_walking.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ mod detail {
9595
string_set: &'a mut StringSet,
9696
}
9797

98-
impl<'a> StringCache<'a> {
98+
impl StringCache<'_> {
9999
/// Makes a copy of the string in the cache slot. If there isn't a
100100
/// string in the slot currently, then create one by calling the
101101
/// provided function, store it in the string cache and cache slot,

profiling/src/sapi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl Sapi {
6262
// Safety: It's not null; the VM should do the rest.
6363
let cstr = unsafe { CStr::from_ptr(*sapi_request_info.argv) };
6464
let bytes = cstr.to_bytes();
65-
return if !bytes.is_empty() {
65+
if !bytes.is_empty() {
6666
let osstr = OsStr::from_bytes(bytes);
6767
Path::new(osstr)
6868
.file_name()
@@ -82,7 +82,7 @@ impl Sapi {
8282
})
8383
} else {
8484
None
85-
};
85+
}
8686
} else {
8787
None
8888
}

profiling/src/thin_str.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl<'a> ThinStr<'a> {
5555
}
5656
}
5757

58-
impl<'a> Deref for ThinStr<'a> {
58+
impl Deref for ThinStr<'_> {
5959
type Target = str;
6060

6161
fn deref(&self) -> &Self::Target {
@@ -75,21 +75,21 @@ impl<'a> Deref for ThinStr<'a> {
7575
}
7676
}
7777

78-
impl<'a> hash::Hash for ThinStr<'a> {
78+
impl hash::Hash for ThinStr<'_> {
7979
fn hash<H: hash::Hasher>(&self, state: &mut H) {
8080
self.deref().hash(state)
8181
}
8282
}
8383

84-
impl<'a> PartialEq for ThinStr<'a> {
84+
impl PartialEq for ThinStr<'_> {
8585
fn eq(&self, other: &Self) -> bool {
8686
self.deref().eq(other.deref())
8787
}
8888
}
8989

90-
impl<'a> Eq for ThinStr<'a> {}
90+
impl Eq for ThinStr<'_> {}
9191

92-
impl<'a> Borrow<str> for ThinStr<'a> {
92+
impl Borrow<str> for ThinStr<'_> {
9393
fn borrow(&self) -> &str {
9494
self.deref()
9595
}

tests/randomized/lib/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111

1212
httpbin:
1313
container_name: httpbin
14-
image: kong/httpbin
14+
image: kong/httpbin:0.2.2
1515

1616
memcached:
1717
container_name: memcached

0 commit comments

Comments
 (0)