mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2025-01-03 11:25:20 +00:00
main: Fix clippy (needless_late_init) issue
warning: unneeded late initalization --> src/main.rs:134:5 | 134 | let mut app: App; | ^^^^^^^^^^^^^^^^^ | = note: `#[warn(clippy::needless_late_init)]` on by default = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_late_init help: declare `app` here | 138 | let mut app: App = App::new("cloud-hypervisor") | ~~~~~~~~~~~~~~~~ Signed-off-by: Rob Bradford <robert.bradford@intel.com>
This commit is contained in:
parent
70af81d755
commit
9c8f291b60
15
src/main.rs
15
src/main.rs
@ -130,12 +130,7 @@ fn create_app<'a>(
|
||||
default_memory: &'a str,
|
||||
default_rng: &'a str,
|
||||
) -> App<'a> {
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
let mut app: App;
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
let app: App;
|
||||
|
||||
app = App::new("cloud-hypervisor")
|
||||
let app = App::new("cloud-hypervisor")
|
||||
// 'BUILT_VERSION' is set by the build script 'build.rs' at
|
||||
// compile time
|
||||
.version(env!("BUILT_VERSION"))
|
||||
@ -372,8 +367,7 @@ fn create_app<'a>(
|
||||
);
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
{
|
||||
app = app.arg(
|
||||
let app = app.arg(
|
||||
Arg::new("sgx-epc")
|
||||
.long("sgx-epc")
|
||||
.help(config::SgxEpcConfig::SYNTAX)
|
||||
@ -381,18 +375,15 @@ fn create_app<'a>(
|
||||
.min_values(1)
|
||||
.group("vm-config"),
|
||||
);
|
||||
}
|
||||
|
||||
#[cfg(feature = "tdx")]
|
||||
{
|
||||
app = app.arg(
|
||||
let app = app.arg(
|
||||
Arg::new("tdx")
|
||||
.long("tdx")
|
||||
.help("TDX Support: firmware=<tdvf path>")
|
||||
.takes_value(true)
|
||||
.group("vm-config"),
|
||||
);
|
||||
}
|
||||
|
||||
app
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user