Skip to content

Commit b56193e

Browse files
lukesteensenbruceg
andauthored
chore: upgrade to rust 1.66.0 (vectordotdev#15093)
* chore: upgrade to rust 1.65.0 Signed-off-by: Luke Steensen <[email protected]> * Fix bool-to-int clippy lint * Fix another lint * bump to 1.66.0 Signed-off-by: Luke Steensen <[email protected]> * clippy fixes Signed-off-by: Luke Steensen <[email protected]> * clippy build.rs Signed-off-by: Luke Steensen <[email protected]> * more fixes Signed-off-by: Luke Steensen <[email protected]> * map_or with identity is unwrap_or Signed-off-by: Luke Steensen <[email protected]> Signed-off-by: Luke Steensen <[email protected]> Co-authored-by: Bruce Guenter <[email protected]>
1 parent 95f2f3a commit b56193e

File tree

181 files changed

+503
-549
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

181 files changed

+503
-549
lines changed

.cargo/config.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@ rustflags = ["-C", "link-args=-rdynamic"]
2424

2525
[target.aarch64-unknown-linux-gnu]
2626
rustflags = ["-C", "link-args=-rdynamic"]
27+
28+
[target.x86_64-pc-windows-msvc]
29+
# https://github.com/dtolnay/inventory/issues/58
30+
rustflags = ["-C", "codegen-units=1"]

Cargo.toml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ readme = "README.md"
1010
publish = false
1111
default-run = "vector"
1212
autobenches = false # our benchmarks are not runnable on their own either way
13-
rust-version = "1.64.0"
13+
rust-version = "1.66.0"
1414

1515
[[bin]]
1616
name = "vector"
@@ -34,9 +34,6 @@ path = "src/config/loading/secret_backend_example.rs"
3434
test = false
3535
bench = false
3636

37-
[profile.dev]
38-
split-debuginfo = "unpacked" # Faster debug builds on macOS
39-
4037
# CI-based builds use full release optimization. See scripts/environment/release-flags.sh.
4138
# This results in roughly a 5% reduction in performance when compiling locally vs when
4239
# compiled via the CI pipeline.

Tiltfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ load('ext://helm_resource', 'helm_resource', 'helm_repo')
77
docker_build(
88
ref='timberio/vector',
99
context='.',
10-
build_args={'RUST_VERSION': '1.64'},
10+
build_args={'RUST_VERSION': '1.66'},
1111
dockerfile='tilt/Dockerfile'
1212
)
1313

build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl BuildConstants {
7171
let base_dir = env::var("OUT_DIR").expect("OUT_DIR not present in build script!");
7272
let dest_path = Path::new(&base_dir).join(file_name);
7373

74-
let mut output_file = File::create(&dest_path)?;
74+
let mut output_file = File::create(dest_path)?;
7575
output_file.write_all(
7676
"// AUTOGENERATED CONSTANTS. SEE BUILD.RS AT REPOSITORY ROOT. DO NOT MODIFY.\n"
7777
.as_ref(),
@@ -108,7 +108,7 @@ fn main() {
108108
println!("cargo:rerun-if-changed=proto/vector.proto");
109109

110110
let mut prost_build = prost_build::Config::new();
111-
prost_build.btree_map(&["."]);
111+
prost_build.btree_map(["."]);
112112

113113
tonic_build::configure()
114114
.protoc_arg("--experimental_allow_proto3_optional")

lib/datadog/grok/src/grok.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'a> Iterator for MatchesIter<'a> {
6464
// that index, if anything.
6565
self.names.next().map(|(k, v)| {
6666
let key = k.as_str();
67-
let value = self.captures.at(*v as usize).unwrap_or("");
67+
let value = self.captures.at(*v).unwrap_or("");
6868
(key, value)
6969
})
7070
}

lib/file-source/src/file_server.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ where
114114
}
115115

116116
existing_files.sort_by_key(|(path, _file_id)| {
117-
fs::metadata(&path)
117+
fs::metadata(path)
118118
.and_then(|m| m.created())
119119
.map(DateTime::<Utc>::from)
120120
.unwrap_or_else(|_| Utc::now())
@@ -206,8 +206,8 @@ where
206206
);
207207
let (old_path, new_path) = (&watcher.path, &path);
208208
if let (Ok(old_modified_time), Ok(new_modified_time)) = (
209-
fs::metadata(&old_path).and_then(|m| m.modified()),
210-
fs::metadata(&new_path).and_then(|m| m.modified()),
209+
fs::metadata(old_path).and_then(|m| m.modified()),
210+
fs::metadata(new_path).and_then(|m| m.modified()),
211211
) {
212212
if old_modified_time < new_modified_time {
213213
info!(

lib/file-source/src/fingerprinter.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,10 @@ mod test {
249249
let full_line_path = target_dir.path().join("full_line.log");
250250
let duplicate_path = target_dir.path().join("duplicate.log");
251251
let not_full_line_path = target_dir.path().join("not_full_line.log");
252-
fs::write(&empty_path, &[]).unwrap();
252+
fs::write(&empty_path, []).unwrap();
253253
fs::write(&full_line_path, &full_line_data).unwrap();
254254
fs::write(&duplicate_path, &full_line_data).unwrap();
255-
fs::write(&not_full_line_path, &not_full_line_data).unwrap();
255+
fs::write(&not_full_line_path, not_full_line_data).unwrap();
256256

257257
let mut buf = Vec::new();
258258
assert!(fingerprinter
@@ -417,8 +417,8 @@ mod test {
417417
let small_path = target_dir.path().join("small.log");
418418
let medium_path = target_dir.path().join("medium.log");
419419
let duplicate_path = target_dir.path().join("duplicate.log");
420-
fs::write(&empty_path, &[]).unwrap();
421-
fs::write(&small_path, &small_data).unwrap();
420+
fs::write(&empty_path, []).unwrap();
421+
fs::write(&small_path, small_data).unwrap();
422422
fs::write(&medium_path, &medium_data).unwrap();
423423
fs::write(&duplicate_path, &medium_data).unwrap();
424424

lib/k8s-test-framework/src/namespace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl up_down::CommandBuilder for CommandBuilder {
4747
up_down::CommandToBuild::Down => "delete",
4848
})
4949
.arg("--filename")
50-
.arg(&self.config.test_namespace_resource_file.path());
50+
.arg(self.config.test_namespace_resource_file.path());
5151

5252
if matches!(command_to_build, up_down::CommandToBuild::Down) {
5353
// We don't need a graceful shutdown

lib/lookup/src/lookup_buf/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ impl Serialize for LookupBuf {
314314
where
315315
S: Serializer,
316316
{
317-
serializer.serialize_str(&*ToString::to_string(self))
317+
serializer.serialize_str(&ToString::to_string(self))
318318
}
319319
}
320320

lib/lookup/src/lookup_v2/jit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl<'a> Iterator for JitValuePathIter<'a> {
286286
self.coalesce_count += 1;
287287
(
288288
Some(Some(BorrowedSegment::CoalesceField(Cow::Borrowed(
289-
&self.path[(start as usize)..(end as usize)],
289+
&self.path[start..end],
290290
)))),
291291
JitState::CoalesceStart,
292292
)
@@ -298,7 +298,7 @@ impl<'a> Iterator for JitValuePathIter<'a> {
298298
self.coalesce_count = 0;
299299
(
300300
Some(Some(BorrowedSegment::CoalesceEnd(Cow::Borrowed(
301-
&self.path[(start as usize)..(end as usize)],
301+
&self.path[start..end],
302302
)))),
303303
JitState::Continue,
304304
)

0 commit comments

Comments
 (0)