From 7bc9dd703b06fda5ff5fe3ba7168841c58e7270e Mon Sep 17 00:00:00 2001 From: Bruce Guenter Date: Fri, 26 Jul 2024 10:42:54 -0600 Subject: [PATCH] chore(deps): Bump Rust version to 1.80 --- .github/actions/spelling/expect.txt | 1 + Cargo.toml | 3 +++ Tiltfile | 2 +- lib/vector-api-client/src/lib.rs | 2 +- lib/vector-buffers/Cargo.toml | 3 +++ lib/vector-buffers/benches/sized_records.rs | 2 +- lib/vector-core/Cargo.toml | 3 +++ lib/vector-core/src/event/discriminant.rs | 1 + lib/vector-core/src/transform/mod.rs | 2 +- rust-toolchain.toml | 2 +- src/config/transform.rs | 2 +- src/config/watcher.rs | 2 +- src/convert_config.rs | 2 +- src/http.rs | 8 +++---- src/internal_events/prelude.rs | 1 - src/kafka.rs | 2 +- .../aws_kinesis/firehose/integration_tests.rs | 4 ++-- src/sinks/elasticsearch/encoder.rs | 3 +++ src/sinks/elasticsearch/integration_tests.rs | 2 +- src/sinks/greptimedb/mod.rs | 8 +++---- src/sinks/kafka/config.rs | 12 +++++----- src/sinks/kafka/tests.rs | 2 +- src/sinks/mod.rs | 2 +- src/sinks/prometheus/collector.rs | 6 +++-- src/sources/docker_logs/tests.rs | 24 +++++++++---------- src/sources/fluent/mod.rs | 2 +- src/sources/kafka.rs | 8 +++---- src/sources/util/framestream.rs | 4 ++-- src/sources/util/unix_datagram.rs | 4 ++-- src/sources/util/unix_stream.rs | 2 +- src/transforms/lua/v1/mod.rs | 6 ++--- vdev/src/platform.rs | 2 +- vdev/src/testing/runner.rs | 2 +- 33 files changed, 72 insertions(+), 59 deletions(-) diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index 952d5f18267aa..14e51ca0db97c 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -144,6 +144,7 @@ centiseconds cernan cfactor CFFI +cfgs CGP cgroups chans diff --git a/Cargo.toml b/Cargo.toml index dd84977d615b3..c7666cd15406a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,6 +50,9 @@ debug = false # Do not include debug symbols in the executable. [profile.bench] debug = true +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] } + [package.metadata.deb] name = "vector" section = "admin" diff --git a/Tiltfile b/Tiltfile index dff7fd4e980db..22902f119b266 100644 --- a/Tiltfile +++ b/Tiltfile @@ -7,7 +7,7 @@ load('ext://helm_resource', 'helm_resource', 'helm_repo') docker_build( ref='timberio/vector', context='.', - build_args={'RUST_VERSION': '1.79.0'}, + build_args={'RUST_VERSION': '1.80.0'}, dockerfile='tilt/Dockerfile' ) diff --git a/lib/vector-api-client/src/lib.rs b/lib/vector-api-client/src/lib.rs index e31401172bdc9..e9850b80c235c 100644 --- a/lib/vector-api-client/src/lib.rs +++ b/lib/vector-api-client/src/lib.rs @@ -6,7 +6,7 @@ //! 2. A GraphQL subscription client, for long-lived, multiplexed subscriptions over WebSockets //! 3. GraphQL queries/mutations/subscriptions, defined in `graphql/**/*.graphql` files //! 4. Extension methods for each client, for executing queries/subscriptions, and returning -//! deserialized JSON responses +//! deserialized JSON responses //! #![deny(warnings)] diff --git a/lib/vector-buffers/Cargo.toml b/lib/vector-buffers/Cargo.toml index 3499d8c9ae5c5..097ba554c9cd0 100644 --- a/lib/vector-buffers/Cargo.toml +++ b/lib/vector-buffers/Cargo.toml @@ -5,6 +5,9 @@ authors = ["Vector Contributors "] edition = "2021" publish = false +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(tokio_unstable)'] } + [dependencies] async-recursion = "1.1.1" async-stream = "0.3.5" diff --git a/lib/vector-buffers/benches/sized_records.rs b/lib/vector-buffers/benches/sized_records.rs index a0abd921fcd4e..80ffd4275d198 100644 --- a/lib/vector-buffers/benches/sized_records.rs +++ b/lib/vector-buffers/benches/sized_records.rs @@ -52,7 +52,7 @@ impl DataDir { fn next(&mut self) -> PathGuard { let mut nxt = self.base.clone(); - nxt.push(&self.index.to_string()); + nxt.push(self.index.to_string()); self.index += 1; std::fs::create_dir_all(&nxt).expect("could not make next dir"); diff --git a/lib/vector-core/Cargo.toml b/lib/vector-core/Cargo.toml index fdba90d440b6b..15e5bded80297 100644 --- a/lib/vector-core/Cargo.toml +++ b/lib/vector-core/Cargo.toml @@ -5,6 +5,9 @@ authors = ["Vector Contributors "] edition = "2021" publish = false +[lints.rust] +unexpected_cfgs = { level = "warn", check-cfg = ['cfg(ddsketch_extended)'] } + [dependencies] async-graphql = { version = "7.0.7", default-features = false, features = ["playground" ], optional = true } async-trait = { version = "0.1", default-features = false } diff --git a/lib/vector-core/src/event/discriminant.rs b/lib/vector-core/src/event/discriminant.rs index b1bd9589ebb81..148dc0c56901f 100644 --- a/lib/vector-core/src/event/discriminant.rs +++ b/lib/vector-core/src/event/discriminant.rs @@ -292,6 +292,7 @@ mod tests { #[test] fn with_hash_map() { + #[allow(clippy::mutable_key_type)] let mut map: HashMap = HashMap::new(); let event_stream_1 = { diff --git a/lib/vector-core/src/transform/mod.rs b/lib/vector-core/src/transform/mod.rs index ae5e61151429d..bad1614785f09 100644 --- a/lib/vector-core/src/transform/mod.rs +++ b/lib/vector-core/src/transform/mod.rs @@ -114,7 +114,7 @@ dyn_clone::clone_trait_object!(FunctionTransform); /// # Invariants /// /// * It is an illegal invariant to implement `FunctionTransform` for a -/// `TaskTransform` or vice versa. +/// `TaskTransform` or vice versa. pub trait TaskTransform: Send + 'static { fn transform( self: Box, diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 39235a11488f1..21c73f28f46c7 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.79" +channel = "1.80" profile = "default" diff --git a/src/config/transform.rs b/src/config/transform.rs index c7315dc80e630..d3c68baf9a69b 100644 --- a/src/config/transform.rs +++ b/src/config/transform.rs @@ -152,7 +152,7 @@ impl TransformContext { } } - #[cfg(any(test, feature = "test"))] + #[cfg(test)] pub fn new_test( schema_definitions: HashMap, HashMap>, ) -> Self { diff --git a/src/config/watcher.rs b/src/config/watcher.rs index bff6fbe7965fe..ae492d44d3a5b 100644 --- a/src/config/watcher.rs +++ b/src/config/watcher.rs @@ -16,7 +16,7 @@ use crate::Error; /// But, config and topology reload logic can handle: /// - Invalid config, caused either by user or by data race. /// - Frequent changes, caused by user/editor modifying/saving file in small chunks. -/// so we can use smaller, more responsive delay. +/// so we can use smaller, more responsive delay. #[cfg(unix)] const CONFIG_WATCH_DELAY: std::time::Duration = std::time::Duration::from_secs(1); diff --git a/src/convert_config.rs b/src/convert_config.rs index d81b998c5ee1f..eead09537084c 100644 --- a/src/convert_config.rs +++ b/src/convert_config.rs @@ -283,7 +283,7 @@ mod tests { let extension = path.extension().unwrap().to_str().unwrap(); if extension == Format::Yaml.to_string() { // Note that here we read the converted string directly. - let converted_config = fs::read_to_string(&output_dir.join(&path)).unwrap(); + let converted_config = fs::read_to_string(output_dir.join(&path)).unwrap(); assert_eq!(converted_config, original_config); count += 1; } diff --git a/src/http.rs b/src/http.rs index bb0218e261884..afc086e13fa95 100644 --- a/src/http.rs +++ b/src/http.rs @@ -444,9 +444,9 @@ impl Default for KeepaliveConfig { /// /// **Notes:** /// - This is intended to be used in a Hyper server (or similar) that will automatically close -/// the connection after a response with a `Connection: close` header is sent. +/// the connection after a response with a `Connection: close` header is sent. /// - This layer assumes that it is instantiated once per connection, which is true within the -/// Hyper framework. +/// Hyper framework. pub struct MaxConnectionAgeLayer { start_reference: Instant, @@ -496,9 +496,9 @@ where /// /// **Notes:** /// - This is intended to be used in a Hyper server (or similar) that will automatically close -/// the connection after a response with a `Connection: close` header is sent. +/// the connection after a response with a `Connection: close` header is sent. /// - This service assumes that it is instantiated once per connection, which is true within the -/// Hyper framework. +/// Hyper framework. #[derive(Clone)] pub struct MaxConnectionAgeService { service: S, diff --git a/src/internal_events/prelude.rs b/src/internal_events/prelude.rs index da809951f726c..8da12ce4b824e 100644 --- a/src/internal_events/prelude.rs +++ b/src/internal_events/prelude.rs @@ -2,7 +2,6 @@ feature = "sources-apache_metrics", feature = "sources-aws_ecs_metrics", feature = "sources-aws_kinesis_firehose", - feature = "sources-http-client", feature = "sources-utils-http", ))] pub(crate) fn http_error_code(code: u16) -> String { diff --git a/src/kafka.rs b/src/kafka.rs index 86d4beaeb3631..8567d19a0613d 100644 --- a/src/kafka.rs +++ b/src/kafka.rs @@ -115,7 +115,7 @@ impl KafkaAuthConfig { if let Some(verify_certificate) = &tls.options.verify_certificate { client.set( "enable.ssl.certificate.verification", - &verify_certificate.to_string(), + verify_certificate.to_string(), ); } diff --git a/src/sinks/aws_kinesis/firehose/integration_tests.rs b/src/sinks/aws_kinesis/firehose/integration_tests.rs index fc9f22e5c5a73..d22f9d2acdf59 100644 --- a/src/sinks/aws_kinesis/firehose/integration_tests.rs +++ b/src/sinks/aws_kinesis/firehose/integration_tests.rs @@ -123,7 +123,7 @@ async fn firehose_put_records_without_partition_key() { #[allow(clippy::needless_collect)] // https://github.com/rust-lang/rust-clippy/issues/6909 let input = input .into_iter() - .map(|rec| serde_json::to_value(&rec.into_log()).unwrap()) + .map(|rec| serde_json::to_value(rec.into_log()).unwrap()) .collect::>(); for hit in hits { let hit = hit @@ -235,7 +235,7 @@ async fn firehose_put_records_with_partition_key() { #[allow(clippy::needless_collect)] // https://github.com/rust-lang/rust-clippy/issues/6909 let input = input .into_iter() - .map(|rec| serde_json::to_value(&rec.into_log()).unwrap()) + .map(|rec| serde_json::to_value(rec.into_log()).unwrap()) .collect::>(); for hit in hits { let hit = hit diff --git a/src/sinks/elasticsearch/encoder.rs b/src/sinks/elasticsearch/encoder.rs index 2ee4f893e6c2a..5973e9689d0ea 100644 --- a/src/sinks/elasticsearch/encoder.rs +++ b/src/sinks/elasticsearch/encoder.rs @@ -126,6 +126,9 @@ impl Encoder> for ElasticsearchEncoder { written_bytes += as_tracked_write::<_, _, io::Error>(writer, &log, |mut writer, log| { writer.write_all(&[b'\n'])?; + // False positive clippy hit on the following line. Clippy wants us to skip the + // borrow, but then the value is moved for the following line. + #[allow(clippy::needless_borrows_for_generic_args)] serde_json::to_writer(&mut writer, log)?; writer.write_all(&[b'\n'])?; Ok(()) diff --git a/src/sinks/elasticsearch/integration_tests.rs b/src/sinks/elasticsearch/integration_tests.rs index 1f627b198f8c8..6f32821212a78 100644 --- a/src/sinks/elasticsearch/integration_tests.rs +++ b/src/sinks/elasticsearch/integration_tests.rs @@ -698,7 +698,7 @@ async fn run_insert_tests_with_config( // https://github.com/rust-lang/rust-clippy/issues/6909 let input = input .into_iter() - .map(|rec| serde_json::to_value(&rec.into_log()).unwrap()) + .map(|rec| serde_json::to_value(rec.into_log()).unwrap()) .collect::>(); for hit in hits { diff --git a/src/sinks/greptimedb/mod.rs b/src/sinks/greptimedb/mod.rs index a8429b67c249d..fc438a78dae65 100644 --- a/src/sinks/greptimedb/mod.rs +++ b/src/sinks/greptimedb/mod.rs @@ -9,15 +9,15 @@ //! This sink transforms metrics into GreptimeDB table using following rules: //! //! - Table name: `{namespace}_{metric_name}`. If the metric doesn't have a -//! namespace, we will use metric_name for table name. +//! namespace, we will use metric_name for table name. //! - Timestamp: timestamp is stored as a column called `ts`. //! - Tags: metric tags are stored as string columns with its name as column -//! name +//! name //! - Counter and Gauge: the value of counter and gauge are stored in a column -//! called `val` +//! called `val` //! - Set: the number of set items is stored in a column called `val`. //! - Distribution, Histogram and Summary, Sketch: Statistical attributes like -//! `sum`, `count`, "max", "min", quantiles and buckets are stored as columns. +//! `sum`, `count`, "max", "min", quantiles and buckets are stored as columns. //! use vector_lib::sensitive_string::SensitiveString; diff --git a/src/sinks/kafka/config.rs b/src/sinks/kafka/config.rs index 5860fa1d291b0..8cadadb1c1f3d 100644 --- a/src/sinks/kafka/config.rs +++ b/src/sinks/kafka/config.rs @@ -157,7 +157,7 @@ impl KafkaSinkConfig { .set("bootstrap.servers", &self.bootstrap_servers) .set( "socket.timeout.ms", - &self.socket_timeout_ms.as_millis().to_string(), + self.socket_timeout_ms.as_millis().to_string(), ) .set("statistics.interval.ms", "1000"); @@ -166,10 +166,10 @@ impl KafkaSinkConfig { // All batch options are producer only. if kafka_role == KafkaRole::Producer { client_config - .set("compression.codec", &to_string(self.compression)) + .set("compression.codec", to_string(self.compression)) .set( "message.timeout.ms", - &self.message_timeout_ms.as_millis().to_string(), + self.message_timeout_ms.as_millis().to_string(), ); if let Some(value) = self.batch.timeout_secs { @@ -190,7 +190,7 @@ impl KafkaSinkConfig { value, "Applying batch option as librdkafka option." ); - client_config.set(key, &((value * 1000.0).round().to_string())); + client_config.set(key, (value * 1000.0).round().to_string()); } if let Some(value) = self.batch.max_events { // Maximum number of messages batched in one MessageSet. The total MessageSet size is @@ -208,7 +208,7 @@ impl KafkaSinkConfig { value, "Applying batch option as librdkafka option." ); - client_config.set(key, &value.to_string()); + client_config.set(key, value.to_string()); } if let Some(value) = self.batch.max_bytes { // Maximum size (in bytes) of all messages batched in one MessageSet, including protocol @@ -229,7 +229,7 @@ impl KafkaSinkConfig { value, "Applying batch option as librdkafka option." ); - client_config.set(key, &value.to_string()); + client_config.set(key, value.to_string()); } } diff --git a/src/sinks/kafka/tests.rs b/src/sinks/kafka/tests.rs index 6d36e77fd6fd2..2f2fd866d9f15 100644 --- a/src/sinks/kafka/tests.rs +++ b/src/sinks/kafka/tests.rs @@ -383,7 +383,7 @@ mod integration_test { // read back everything from the beginning let mut client_config = rdkafka::ClientConfig::new(); client_config.set("bootstrap.servers", server.as_str()); - client_config.set("group.id", &random_string(10)); + client_config.set("group.id", random_string(10)); client_config.set("enable.partition.eof", "true"); kafka_auth.apply(&mut client_config).unwrap(); diff --git a/src/sinks/mod.rs b/src/sinks/mod.rs index 6442e2d1585fe..79f2a0a61645b 100644 --- a/src/sinks/mod.rs +++ b/src/sinks/mod.rs @@ -20,7 +20,7 @@ pub mod aws_cloudwatch_metrics; pub mod aws_kinesis; #[cfg(feature = "sinks-aws_s3")] pub mod aws_s3; -#[cfg(any(feature = "sinks-aws_sqs", feature = "sinks-sinks-aws_sns"))] +#[cfg(feature = "sinks-aws_sqs")] pub mod aws_s_s; #[cfg(feature = "sinks-axiom")] pub mod axiom; diff --git a/src/sinks/prometheus/collector.rs b/src/sinks/prometheus/collector.rs index 99a428e8f6124..ccefcb653475d 100644 --- a/src/sinks/prometheus/collector.rs +++ b/src/sinks/prometheus/collector.rs @@ -943,9 +943,11 @@ mod tests { } /// According to the [spec](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md?plain=1#L115) + /// /// > Label names MUST be unique within a LabelSet. - /// Prometheus itself will reject the metric with an error. Largely to remain backward compatible with older versions of Vector, - /// we only publish the last tag in the list. + /// + /// Prometheus itself will reject the metric with an error. Largely to remain backward + /// compatible with older versions of Vector, we only publish the last tag in the list. #[test] fn encodes_duplicate_tags() { let tags = metric_tags!( diff --git a/src/sources/docker_logs/tests.rs b/src/sources/docker_logs/tests.rs index f68e3580920c5..72b0dd75ee96f 100644 --- a/src/sources/docker_logs/tests.rs +++ b/src/sources/docker_logs/tests.rs @@ -25,6 +25,18 @@ fn exclude_self() { #[cfg(all(test, feature = "docker-logs-integration-tests"))] mod integration_tests { + use bollard::{ + container::{ + Config as ContainerConfig, CreateContainerOptions, KillContainerOptions, + RemoveContainerOptions, StartContainerOptions, WaitContainerOptions, + }, + image::{CreateImageOptions, ListImagesOptions}, + }; + use futures::{stream::TryStreamExt, FutureExt}; + use itertools::Itertools as _; + use similar_asserts::assert_eq; + use vrl::value; + use crate::sources::docker_logs::*; use crate::sources::docker_logs::{CONTAINER, CREATED_AT, IMAGE, NAME}; use crate::{ @@ -36,16 +48,6 @@ mod integration_tests { }, SourceSender, }; - use bollard::{ - container::{ - Config as ContainerConfig, CreateContainerOptions, KillContainerOptions, - RemoveContainerOptions, StartContainerOptions, WaitContainerOptions, - }, - image::{CreateImageOptions, ListImagesOptions}, - }; - use futures::{stream::TryStreamExt, FutureExt}; - use similar_asserts::assert_eq; - use vrl::value; /// None if docker is not present on the system async fn source_with<'a, L: Into>>( @@ -869,7 +871,6 @@ mod integration_tests { let command = emitted_messages .into_iter() .map(|message| format!("echo {:?}", message)) - .collect::>() .join(" && "); let id = cmd_container(name, None, vec!["sh", "-c", &command], &docker, false).await; @@ -940,7 +941,6 @@ mod integration_tests { let command = emitted_messages .into_iter() .map(|message| format!("echo {:?}", message)) - .collect::>() .join(" && "); let id = cmd_container(name, None, vec!["sh", "-c", &command], &docker, false).await; diff --git a/src/sources/fluent/mod.rs b/src/sources/fluent/mod.rs index c2bc3c9ba1ecd..66373452f5562 100644 --- a/src/sources/fluent/mod.rs +++ b/src/sources/fluent/mod.rs @@ -471,7 +471,7 @@ impl Decoder for FluentDecoder { src.advance(byte_size); let maybe_item = self.handle_message(res, byte_size).map_err(|error| { - let base64_encoded_message = BASE64_STANDARD.encode(&src); + let base64_encoded_message = BASE64_STANDARD.encode(&src[..]); emit!(FluentMessageDecodeError { error: &error, base64_encoded_message diff --git a/src/sources/kafka.rs b/src/sources/kafka.rs index 15f7315721c81..dc35bc15b91b6 100644 --- a/src/sources/kafka.rs +++ b/src/sources/kafka.rs @@ -1202,21 +1202,21 @@ fn create_consumer( .set("auto.offset.reset", &config.auto_offset_reset) .set( "session.timeout.ms", - &config.session_timeout_ms.as_millis().to_string(), + config.session_timeout_ms.as_millis().to_string(), ) .set( "socket.timeout.ms", - &config.socket_timeout_ms.as_millis().to_string(), + config.socket_timeout_ms.as_millis().to_string(), ) .set( "fetch.wait.max.ms", - &config.fetch_wait_max_ms.as_millis().to_string(), + config.fetch_wait_max_ms.as_millis().to_string(), ) .set("enable.partition.eof", "false") .set("enable.auto.commit", "true") .set( "auto.commit.interval.ms", - &config.commit_interval_ms.as_millis().to_string(), + config.commit_interval_ms.as_millis().to_string(), ) .set("enable.auto.offset.store", "false") .set("statistics.interval.ms", "1000") diff --git a/src/sources/util/framestream.rs b/src/sources/util/framestream.rs index da1c395d84c85..404e56c306306 100644 --- a/src/sources/util/framestream.rs +++ b/src/sources/util/framestream.rs @@ -565,7 +565,7 @@ async fn handle_stream( frame_handler.insert_tls_client_metadata(certificate_metadata); let span = info_span!("connection"); - span.record("peer_addr", &field::debug(&peer_addr)); + span.record("peer_addr", field::debug(&peer_addr)); let received_from: Option = Some(peer_addr.to_string().into()); let active_parsing_task_nums = Arc::new(AtomicU32::new(0)); @@ -688,7 +688,7 @@ pub fn build_framestream_unix_source( let span = info_span!("connection"); let path = if let Some(addr) = peer_addr { if let Some(path) = addr.as_pathname().map(|e| e.to_owned()) { - span.record("peer_path", &field::debug(&path)); + span.record("peer_path", field::debug(&path)); Some(path) } else { None diff --git a/src/sources/util/unix_datagram.rs b/src/sources/util/unix_datagram.rs index af3ce7c01e336..7800b760090f5 100644 --- a/src/sources/util/unix_datagram.rs +++ b/src/sources/util/unix_datagram.rs @@ -82,7 +82,7 @@ async fn listen( let span = info_span!("datagram"); let received_from = if !address.is_unnamed() { let path = address.as_pathname().map(|e| e.to_owned()).map(|path| { - span.record("peer_path", &field::debug(&path)); + span.record("peer_path", field::debug(&path)); path }); @@ -92,7 +92,7 @@ async fn listen( // socket from an unnamed socket (a socket not // bound to a file). Instead of a filename, we'll // surface a specific host value. - span.record("peer_path", &field::debug(UNNAMED_SOCKET_HOST)); + span.record("peer_path", field::debug(UNNAMED_SOCKET_HOST)); Some(UNNAMED_SOCKET_HOST.into()) }; diff --git a/src/sources/util/unix_stream.rs b/src/sources/util/unix_stream.rs index 00dbd0b5ef070..a08bf59b9de19 100644 --- a/src/sources/util/unix_stream.rs +++ b/src/sources/util/unix_stream.rs @@ -79,7 +79,7 @@ pub fn build_unix_stream_source( .and_then(|addr| { addr.as_pathname().map(|e| e.to_owned()).map({ |path| { - span.record("peer_path", &field::debug(&path)); + span.record("peer_path", field::debug(&path)); path.to_string_lossy().into_owned().into() } }) diff --git a/src/transforms/lua/v1/mod.rs b/src/transforms/lua/v1/mod.rs index b329cd732a4a8..ff004aa9c515b 100644 --- a/src/transforms/lua/v1/mod.rs +++ b/src/transforms/lua/v1/mod.rs @@ -275,7 +275,7 @@ impl mlua::UserData for LuaEvent { .ok() .flatten() { - let string = lua.create_string(&value.coerce_to_bytes())?; + let string = lua.create_string(value.coerce_to_bytes())?; Ok(Some(string)) } else { Ok(None) @@ -306,9 +306,7 @@ impl mlua::UserData for LuaEvent { .flatten() }); match value { - Some(value) => { - Ok((key, Some(lua.create_string(&value.coerce_to_bytes())?))) - } + Some(value) => Ok((key, Some(lua.create_string(value.coerce_to_bytes())?))), None => Ok((None, None)), } })?; diff --git a/vdev/src/platform.rs b/vdev/src/platform.rs index 7013c285f01d0..486105e5bc4df 100644 --- a/vdev/src/platform.rs +++ b/vdev/src/platform.rs @@ -25,7 +25,7 @@ pub fn data_dir() -> &'static Path { pub fn default_target() -> String { if cfg!(windows) { format!("{ARCH}-pc-windows-msvc") - } else if cfg!(macos) { + } else if cfg!(target_os = "macos") { format!("{ARCH}-apple-darwin") } else { format!("{ARCH}-unknown-linux-gnu") diff --git a/vdev/src/testing/runner.rs b/vdev/src/testing/runner.rs index e247f69c20c7f..a58c3fb54ae74 100644 --- a/vdev/src/testing/runner.rs +++ b/vdev/src/testing/runner.rs @@ -294,7 +294,7 @@ where }; } - command.arg(&self.container_name()); + command.arg(self.container_name()); command.args(TEST_COMMAND); command.args(args);