Compare commits

..

No commits in common. "381df2e644a01182069d62c26a96a71ea7593baa" and "17d3c6469ec07ed9c6abb1c093bf090f6188a9cf" have entirely different histories.

2 changed files with 4 additions and 6 deletions

View file

@ -37,7 +37,6 @@ fn main() {
let dbus_paths_raw = let dbus_paths_raw =
env::var("DBUS_XML_PATH").unwrap_or("/usr/share/dbus-1/interfaces".to_string()); env::var("DBUS_XML_PATH").unwrap_or("/usr/share/dbus-1/interfaces".to_string());
fs::create_dir_all(out_dir.join("generated")).unwrap();
dbus_paths_raw dbus_paths_raw
.split(':') .split(':')
.map(fs::read_dir) .map(fs::read_dir)
@ -65,7 +64,7 @@ fn main() {
.strip_suffix(".xml") .strip_suffix(".xml")
.unwrap() .unwrap()
.replace('.', "_"); .replace('.', "_");
let out_path = out_dir.join(format!("generated/{module_name}.rs")); let out_path = out_dir.join(module_name.clone() + ".rs");
fs::File::create(out_path) fs::File::create(out_path)
.unwrap() .unwrap()
.write_all(code.as_bytes()) .write_all(code.as_bytes())
@ -75,7 +74,7 @@ fn main() {
.write_all( .write_all(
format!( format!(
r#"mod {module_name} {{ r#"mod {module_name} {{
include!(concat!(env!("OUT_DIR"), "/generated/{module_name}.rs")); include!(concat!(env!("OUT_DIR"), "/{module_name}.rs"));
}} }}
pub use {module_name}::*; pub use {module_name}::*;
"# "#

View file

@ -14,14 +14,13 @@ pub async fn network_manager(
_output: OutputChannel, _output: OutputChannel,
dbus_conn: Arc<SyncConnection>, dbus_conn: Arc<SyncConnection>,
) -> eyre::Result<Infallible> { ) -> eyre::Result<Infallible> {
let destination = "org.freedesktop.NetworkManager"; let destination = "org.freedesktop.NetworkManager";
let timeout = Duration::from_secs(5); let timeout = Duration::from_secs(5);
let connection = dbus_conn.as_ref(); let connection = dbus_conn.as_ref();
let make_proxy = |path| Proxy::new(destination, path, timeout, connection); let make_proxy = |path| Proxy::new(destination, path, timeout, connection);
let primary_connection = make_proxy("/org/freedesktop/NetworkManager".into()) let primary_connection = make_proxy("/org/freedesktop/NetworkManager".into()).primary_connection().await?;
.primary_connection()
.await?;
let specific_object = make_proxy(primary_connection).specific_object().await?; let specific_object = make_proxy(primary_connection).specific_object().await?;
let ssid = make_proxy(specific_object).ssid().await?; let ssid = make_proxy(specific_object).ssid().await?;