use line!, col!, and row! instead of panic location

This commit is contained in:
Evan Almloff committed 2022-06-20 15:44:14 -05:00
1 parent 2908e53d1b
commit 7025bd43aa
2 files changed
+2 -5

No files matched your search

+1 -1
View File
@@ -97,7 +97,7 @@ pub async fn hot_reload_handler(
if let DiffResult::RsxChanged(changed) = find_rsx(&new_file, &old_file) { if let DiffResult::RsxChanged(changed) = find_rsx(&new_file, &old_file) {
for (old, new) in changed.into_iter() { for (old, new) in changed.into_iter() {
let hr = get_location( let hr = get_location(
k.strip_prefix(&state.watcher_config.crate_dir).unwrap(), k,
old.to_token_stream(), old.to_token_stream(),
); );
// get the original source code to preserve whitespace // get the original source code to preserve whitespace
+1 -4
View File
@@ -121,10 +121,7 @@ pub async fn startup_hot_reload(config: CrateConfig) -> Result<()> {
log::info!("reloading rsx"); log::info!("reloading rsx");
for (old, new) in changed.into_iter() { for (old, new) in changed.into_iter() {
let hr = get_location( let hr = get_location(
&path &path.to_path_buf(),
.strip_prefix(&crate_dir)
.unwrap()
.to_path_buf(),
old.to_token_stream(), old.to_token_stream(),
); );
// get the original source code to preserve whitespace // get the original source code to preserve whitespace