Use closure internally to fetch graphics_info
This commit is contained in:
parent
8643fbef90
commit
6e167675d6
3 changed files with 11 additions and 14 deletions
|
|
@ -17,7 +17,7 @@ pub fn fetch_information<Message>(
|
|||
|
||||
#[cfg(feature = "sysinfo")]
|
||||
pub(crate) fn get_information(
|
||||
graphics_info: &compositor::Information,
|
||||
graphics_info: compositor::Information,
|
||||
) -> Option<Information> {
|
||||
use sysinfo::{ProcessExt, ProcessorExt, System, SystemExt};
|
||||
let mut system = System::new_all();
|
||||
|
|
@ -38,8 +38,8 @@ pub(crate) fn get_information(
|
|||
cpu_cores: system.physical_core_count(),
|
||||
memory_total: system.total_memory(),
|
||||
memory_used,
|
||||
graphics_adapter: graphics_info.adapter.clone(),
|
||||
graphics_backend: graphics_info.backend.clone(),
|
||||
graphics_adapter: graphics_info.adapter,
|
||||
graphics_backend: graphics_info.backend,
|
||||
};
|
||||
|
||||
Some(information)
|
||||
|
|
@ -47,7 +47,7 @@ pub(crate) fn get_information(
|
|||
|
||||
#[cfg(not(feature = "sysinfo"))]
|
||||
pub(crate) fn get_information(
|
||||
_graphics_info: &compositor::Information,
|
||||
_graphics_info: compositor::Information,
|
||||
) -> Option<Information> {
|
||||
None
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue