Skip to content

Commit 811b686

Browse files
authored
Merge pull request #67 from SoftwareDefinedVehicle/mhfixes2
Replaced deprecated dependency "tempdir"
2 parents 284871a + fd8d0a2 commit 811b686

File tree

4 files changed

+5
-67
lines changed

4 files changed

+5
-67
lines changed

src/rust/blueprint-selector/Cargo.lock

Lines changed: 1 addition & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/blueprint-selector/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ rumqttc = "0.24.0"
2424
serde = { version = "1.0.188", features = ["derive"] }
2525
serde_json = "1.0.105"
2626
strum = { version = "0.27.2", features = ["derive"] }
27-
tempdir = "0.3.7"
27+
tempfile = "3.20.0"
2828
walkdir = "2.3.3"

src/rust/blueprint-selector/src/blueprint_fetchers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use git2::Repository;
1616
use reqwest::{blocking, Url};
1717
use std::{fmt::Display, fs, path::Path, rc::Rc};
1818
use strum::{EnumIter, IntoEnumIterator};
19-
use tempdir::TempDir;
19+
use tempfile::tempdir;
2020

2121
#[derive(Debug, EnumIter)]
2222
pub enum FetcherKind {
@@ -95,7 +95,7 @@ impl Fetcher {
9595
}
9696

9797
fn git_repo(self) -> Result<()> {
98-
let temp_dir = TempDir::new("blueprints_repo")?;
98+
let temp_dir = tempdir()?;
9999
println!("Cloning into repository.");
100100
let _repo = Repository::clone(self.uri.as_str(), &temp_dir)?;
101101
copy_dir_recursive(&temp_dir, self.output_dir)?;

src/rust/blueprint-selector/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn load_blueprints(dir: &Path, extension: &str) -> Vec<Blueprint> {
127127
fn publish_blueprint(message: &str, mqtt_conf: &MQTTconfig) -> Result<()> {
128128
let mut mqttoptions = MqttOptions::new("blueprints-selector", &mqtt_conf.host, mqtt_conf.port);
129129
mqttoptions.set_keep_alive(Duration::from_secs(5));
130-
let (mut client, mut connection) = Client::new(mqttoptions, 10);
130+
let (client, mut connection) = Client::new(mqttoptions, 10);
131131
client.publish(&mqtt_conf.topic, QoS::ExactlyOnce, false, message)?;
132132

133133
// Spin the event loop and wait for pub completed packet

0 commit comments

Comments
 (0)