on master help sign in
dap: use smallvec! macro
4d24a43Blaž Hrastnik
helix-core/src/lib.rs+1−1
@@ -195,7 +195,7 @@ pub use {regex, tree_sitter};
195pub use graphemes::RopeGraphemes;
195pub use graphemes::RopeGraphemes;
196pub use position::{coords_at_pos, pos_at_coords, Position};
196pub use position::{coords_at_pos, pos_at_coords, Position};
197pub use selection::{Range, Selection};
197pub use selection::{Range, Selection};
198−pub use smallvec::SmallVec;
198+pub use smallvec::{smallvec, SmallVec};
199pub use syntax::Syntax;
199pub use syntax::Syntax;
200
200
201pub use diagnostic::Diagnostic;
201pub use diagnostic::Diagnostic;
helix-term/src/application.rs+3−3
@@ -327,7 +327,7 @@ impl Application {
327 let path = path.clone();
327 let path = path.clone();
328 self.editor
328 self.editor
329 .open(path, helix_view::editor::Action::Replace)
329 .open(path, helix_view::editor::Action::Replace)
330− .unwrap();
330+ .unwrap(); // TODO: there should be no unwrapping!
331
331
332 let (view, doc) = current!(self.editor);
332 let (view, doc) = current!(self.editor);
333
333
@@ -351,10 +351,10 @@ impl Application {
351 .unwrap_or(0);
351 .unwrap_or(0);
352
352
353 Selection::new(
353 Selection::new(
354− helix_core::SmallVec::from_vec(vec![Range::new(
354+ helix_core::smallvec![Range::new(
355 start.min(text_end),
355 start.min(text_end),
356 end.min(text_end),
356 end.min(text_end),
357− )]),
357+ )],
358 0,
358 0,
359 )
359 )
360 } else {
360 } else {