use alloc ::{ borrow ::ToOwned, string ::String, vec ::Vec };
#[ derive( Debug, Clone ) ]
pub struct ShellArgv( Vec< String > );
impl ShellArgv
{
pub fn from_vec( argv : Vec< String > ) -> Self
{
Self( argv )
}
pub fn as_slice( &self ) -> &[ String ]
{
&self.0
}
#[ cfg( not( feature = "no_std" ) ) ]
pub fn from_env() -> Self
{
Self( ::std ::env ::args().collect() )
}
}
impl From< Vec< String > > for ShellArgv
{
fn from( v : Vec< String > ) -> Self { Self( v ) }
}
#[ derive( Debug, Clone ) ]
pub struct ReplInput( String );
impl ReplInput
{
pub fn new( s : &str ) -> Self { Self( s.to_owned() ) }
pub fn as_str( &self ) -> &str { &self.0 }
}
impl From< &str > for ReplInput
{
fn from( s : &str ) -> Self { Self( s.to_owned() ) }
}
impl From< String > for ReplInput
{
fn from( s : String ) -> Self { Self( s ) }
}