mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
feat: iterating find dedicate instance is not needed (#1369)
This commit is contained in:
parent
876e402b26
commit
9ad8722ac8
1 changed files with 1 additions and 9 deletions
|
@ -358,15 +358,7 @@ impl ServerState {
|
|||
.restart_dedicate(&task_id, Some(entry))
|
||||
.map_err(internal_error)?;
|
||||
|
||||
// Gets the task-dedicated compile server.
|
||||
let mut dedicates = self.project.compiler.dedicates.iter_mut();
|
||||
let Some(dedicate) = dedicates.find(|d| d.id == id) else {
|
||||
return Err(invalid_params(
|
||||
"just restarted compiler instance for the task is not found",
|
||||
));
|
||||
};
|
||||
|
||||
if !self.project.preview.register(&dedicate.id, watcher) {
|
||||
if !self.project.preview.register(&id, watcher) {
|
||||
return Err(invalid_params(
|
||||
"cannot register preview to the compiler instance",
|
||||
));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue