fix autofmt: don't panic when writing blocks out without a srcfile (#2854)

* fix: don't panic when writing blocks out
* also fix serialization for hotreload
* fix windows line endings
This commit is contained in:
Jonathan Kelley authored and GitHub committed 2024-08-16 21:55:30 -07:00
1 parent b47a6cf83e
commit 4963aa3118
9 files changed
+142 -46

No files matched your search

+2 -2
View File
@@ -51,8 +51,8 @@ impl NativeReceiver {
match res {
Ok(res) => match res {
Message::Text(text) => {
let leaked: &'static str = Box::leak(text.into_boxed_str());
let msg = serde_json::from_str::<DevserverMsg>(leaked);
// let leaked: &'static str = Box::leak(text.into_boxed_str());
let msg = serde_json::from_str::<DevserverMsg>(&text);
if let Ok(msg) = msg {
return Some(Ok(msg));
}