aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharisee <chiw@google.com>2024-03-20 18:40:22 +0000
committerCharisee Chiw <chiw@google.com>2024-03-27 19:53:24 +0000
commit58708f5d7b91c53be31a0c12aa81c2e332872244 (patch)
tree714b71da556e92e707007db660472338a4a9dc80
parentbb508889871ef017176880568a460fed95179226 (diff)
downloadbuild-58708f5d7b91c53be31a0c12aa81c2e332872244.tar.gz
Update needed for Rust v1.77.0
error: this `let...else` may be rewritten with the `?` operator --> build/make/tools/aconfig/aconfig/src/commands.rs:320:5 | 320 | / let Some(package) = parsed_flags.first().map(|pf| pf.package()) else { 321 | | return None; 322 | | }; | |______^ help: replace it with: `let package = parsed_flags.first().map(|pf| pf.package())?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ques tion_mark = note: `-D clippy::question-mark` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(clippy::question_mark)]` error: this `let...else` may be rewritten with the `?` operator --> build/make/tools/aconfig/aconfig/src/commands.rs:330:5 | 330 | / let Some(container) = parsed_flags.parsed_flag.first().map(|pf| pf.container()) else { 331 | | return None; 332 | | }; | |______^ help: replace it with: `let container = parsed_flags.parsed_flag.first().map(|pf| pf.cont ainer())?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ques tion_mark error: aborting due to 2 previous errors Bug: 330185853 Test: ./test_compiler.py --prebuilt-path dist/rust-dev.tar.xz --target aosp_cf_x86_64_phone --image Change-Id: I00e22fc75137e8bd6fe28a8c20f8a1c3bbe711fd
-rw-r--r--tools/aconfig/aconfig/src/commands.rs8
1 files changed, 2 insertions, 6 deletions
diff --git a/tools/aconfig/aconfig/src/commands.rs b/tools/aconfig/aconfig/src/commands.rs
index 98dde4455f..7736ce75ee 100644
--- a/tools/aconfig/aconfig/src/commands.rs
+++ b/tools/aconfig/aconfig/src/commands.rs
@@ -317,9 +317,7 @@ pub fn dump_parsed_flags(
}
fn find_unique_package(parsed_flags: &[ProtoParsedFlag]) -> Option<&str> {
- let Some(package) = parsed_flags.first().map(|pf| pf.package()) else {
- return None;
- };
+ let package = parsed_flags.first().map(|pf| pf.package())?;
if parsed_flags.iter().any(|pf| pf.package() != package) {
return None;
}
@@ -327,9 +325,7 @@ fn find_unique_package(parsed_flags: &[ProtoParsedFlag]) -> Option<&str> {
}
fn find_unique_container(parsed_flags: &ProtoParsedFlags) -> Option<&str> {
- let Some(container) = parsed_flags.parsed_flag.first().map(|pf| pf.container()) else {
- return None;
- };
+ let container = parsed_flags.parsed_flag.first().map(|pf| pf.container())?;
if parsed_flags.parsed_flag.iter().any(|pf| pf.container() != container) {
return None;
}