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:
1 parent
b47a6cf83e
commit
4963aa3118
9 files changed
+142
-46
No files matched your search
@@ -57,9 +57,9 @@ fn make_ws(tx: UnboundedSender<HotReloadMsg>, poll_interval: i32, reload: bool)
|
||||
|
||||
// The devserver messages have some &'static strs in them, so we need to leak the source string
|
||||
let string: String = text.into();
|
||||
let leaked: &'static str = Box::leak(Box::new(string));
|
||||
// let leaked: &'static str = Box::leak(Box::new(string));
|
||||
|
||||
match serde_json::from_str::<DevserverMsg>(leaked) {
|
||||
match serde_json::from_str::<DevserverMsg>(&string) {
|
||||
Ok(DevserverMsg::HotReload(hr)) => _ = tx_.unbounded_send(hr),
|
||||
|
||||
// todo: we want to throw a screen here that shows the user that the devserver has disconnected
|
||||
|
||||
Reference in new issue
Block a user