pass clippy
This commit is contained in:
1 parent
6c804cded7
commit
fc28050da6
1 file changed
+19
-21
@@ -32,28 +32,26 @@ pub fn init<Ctx: HotReloadingContext + Send + 'static>(
|
|||||||
let file_map = file_map.clone();
|
let file_map = file_map.clone();
|
||||||
let channels = channels.clone();
|
let channels = channels.clone();
|
||||||
move || {
|
move || {
|
||||||
for connection in local_socket_stream.incoming() {
|
for mut connection in local_socket_stream.incoming().flatten() {
|
||||||
if let Ok(mut connection) = connection {
|
// send any templates than have changed before the socket connected
|
||||||
// send any templates than have changed before the socket connected
|
let templates: Vec<_> = {
|
||||||
let templates: Vec<_> = {
|
file_map
|
||||||
file_map
|
.lock()
|
||||||
.lock()
|
.unwrap()
|
||||||
.unwrap()
|
.map
|
||||||
.map
|
.values()
|
||||||
.values()
|
.filter_map(|(_, template_slot)| *template_slot)
|
||||||
.filter_map(|(_, template_slot)| *template_slot)
|
.collect()
|
||||||
.collect()
|
};
|
||||||
};
|
for template in templates {
|
||||||
for template in templates {
|
if !send_template(template, &mut connection) {
|
||||||
if !send_template(template, &mut connection) {
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
channels.lock().unwrap().push(connection);
|
|
||||||
if log {
|
|
||||||
println!("Connected to hot reloading 🚀");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
channels.lock().unwrap().push(connection);
|
||||||
|
if log {
|
||||||
|
println!("Connected to hot reloading 🚀");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -102,7 +100,7 @@ pub fn init<Ctx: HotReloadingContext + Send + 'static>(
|
|||||||
match file_map
|
match file_map
|
||||||
.lock()
|
.lock()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.update_rsx(&path, crate_dir.as_path())
|
.update_rsx(path, crate_dir.as_path())
|
||||||
{
|
{
|
||||||
UpdateResult::UpdatedRsx(msgs) => {
|
UpdateResult::UpdatedRsx(msgs) => {
|
||||||
for msg in msgs {
|
for msg in msgs {
|
||||||
|
|||||||
Reference in new issue
Block a user