Various additions and improvements

This commit is contained in:
2025-03-15 21:04:45 -04:00
parent 7f21e5baa7
commit 505b968c60
31 changed files with 1421 additions and 341 deletions

View File

@@ -29,9 +29,8 @@ impl<'s> ShErr {
let msg = msg.into();
Self::Simple { kind, msg }
}
pub fn full(kind: ShErrKind, msg: impl Into<String>, span: Span<'s>) -> Self {
pub fn full(kind: ShErrKind, msg: impl Into<String>, span: ErrSpan) -> Self {
let msg = msg.into();
let span = span.into();
Self::Full { kind, msg, span }
}
pub fn unpack(self) -> (ShErrKind,String,Option<ErrSpan>) {

View File

@@ -2,3 +2,4 @@ pub mod error;
pub mod term;
pub mod flog;
pub mod sys;
pub mod utils;

11
src/libsh/utils.rs Normal file
View File

@@ -0,0 +1,11 @@
use std::collections::VecDeque;
pub trait VecDequeExt<T> {
fn to_vec(self) -> Vec<T>;
}
impl<T> VecDequeExt<T> for VecDeque<T> {
fn to_vec(self) -> Vec<T> {
self.into_iter().collect::<Vec<T>>()
}
}