Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-view/src/handlers/lsp.rs')
-rw-r--r--helix-view/src/handlers/lsp.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/helix-view/src/handlers/lsp.rs b/helix-view/src/handlers/lsp.rs
index d817a423..6aff2e50 100644
--- a/helix-view/src/handlers/lsp.rs
+++ b/helix-view/src/handlers/lsp.rs
@@ -1,3 +1,5 @@
+use std::fmt::Display;
+
use crate::editor::Action;
use crate::Editor;
use crate::{DocumentId, ViewId};
@@ -73,13 +75,13 @@ impl From<helix_core::uri::UrlConversionError> for ApplyEditErrorKind {
}
}
-impl ToString for ApplyEditErrorKind {
- fn to_string(&self) -> String {
+impl Display for ApplyEditErrorKind {
+ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
- ApplyEditErrorKind::DocumentChanged => "document has changed".to_string(),
- ApplyEditErrorKind::FileNotFound => "file not found".to_string(),
- ApplyEditErrorKind::InvalidUrl(err) => err.to_string(),
- ApplyEditErrorKind::IoError(err) => err.to_string(),
+ ApplyEditErrorKind::DocumentChanged => f.write_str("document has changed"),
+ ApplyEditErrorKind::FileNotFound => f.write_str("file not found"),
+ ApplyEditErrorKind::InvalidUrl(err) => f.write_str(&format!("{err}")),
+ ApplyEditErrorKind::IoError(err) => f.write_str(&format!("{err}")),
}
}
}