Various additions and improvements
This commit is contained in:
@@ -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>) {
|
||||
|
||||
@@ -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
11
src/libsh/utils.rs
Normal 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>>()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user