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
41
src/main.rs
41
src/main.rs
@ -130,12 +130,7 @@ fn create_app<'a>(
|
|||||||
default_memory: &'a str,
|
default_memory: &'a str,
|
||||||
default_rng: &'a str,
|
default_rng: &'a str,
|
||||||
) -> App<'a> {
|
) -> App<'a> {
|
||||||
#[cfg(target_arch = "x86_64")]
|
let app = App::new("cloud-hypervisor")
|
||||||
let mut app: App;
|
|
||||||
#[cfg(target_arch = "aarch64")]
|
|
||||||
let app: App;
|
|
||||||
|
|
||||||
app = App::new("cloud-hypervisor")
|
|
||||||
// 'BUILT_VERSION' is set by the build script 'build.rs' at
|
// 'BUILT_VERSION' is set by the build script 'build.rs' at
|
||||||
// compile time
|
// compile time
|
||||||
.version(env!("BUILT_VERSION"))
|
.version(env!("BUILT_VERSION"))
|
||||||
@ -372,27 +367,23 @@ fn create_app<'a>(
|
|||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(target_arch = "x86_64")]
|
#[cfg(target_arch = "x86_64")]
|
||||||
{
|
let app = app.arg(
|
||||||
app = app.arg(
|
Arg::new("sgx-epc")
|
||||||
Arg::new("sgx-epc")
|
.long("sgx-epc")
|
||||||
.long("sgx-epc")
|
.help(config::SgxEpcConfig::SYNTAX)
|
||||||
.help(config::SgxEpcConfig::SYNTAX)
|
.takes_value(true)
|
||||||
.takes_value(true)
|
.min_values(1)
|
||||||
.min_values(1)
|
.group("vm-config"),
|
||||||
.group("vm-config"),
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "tdx")]
|
#[cfg(feature = "tdx")]
|
||||||
{
|
let app = app.arg(
|
||||||
app = app.arg(
|
Arg::new("tdx")
|
||||||
Arg::new("tdx")
|
.long("tdx")
|
||||||
.long("tdx")
|
.help("TDX Support: firmware=<tdvf path>")
|
||||||
.help("TDX Support: firmware=<tdvf path>")
|
.takes_value(true)
|
||||||
.takes_value(true)
|
.group("vm-config"),
|
||||||
.group("vm-config"),
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
app
|
app
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user