mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:45:41 +02:00
Added new flag '--all/-a' for Ls, also refactor some code (#1483)
* Utility function to detect hidden folders.
Implemented for Unix and Windows.
* Rename function argument.
* Revert "Rename function argument."
This reverts commit e7ab70f0f0
.
* Add flag '--all/-a' to Ls
* Rename function argument.
* Check if flag '--all/-a' is present and path is hidden.
Replace match with map_err for glob result.
Remove redundancy in stream body.
Included comments on new stream body.
Replace async_stream::stream with async_stream::try_stream.
Minor tweaks to is_empty_dir.
Fix and refactor is_hidden_dir.
* Fix "implicit" bool coerse
* Fixed clippy errors
This commit is contained in:
@ -137,7 +137,7 @@ pub struct ExpandContext<'context> {
|
||||
|
||||
impl<'context> ExpandContext<'context> {
|
||||
pub(crate) fn homedir(&self) -> Option<&Path> {
|
||||
self.homedir.as_ref().map(|h| h.as_path())
|
||||
self.homedir.as_deref()
|
||||
}
|
||||
|
||||
pub(crate) fn source(&self) -> &'context Text {
|
||||
|
@ -372,7 +372,7 @@ fn word<'a, T, U, V>(
|
||||
let (input, _) = start_predicate(input)?;
|
||||
let (input, _) = many0(next_predicate)(input)?;
|
||||
|
||||
let next_char = &input.fragment.chars().nth(0);
|
||||
let next_char = &input.fragment.chars().next();
|
||||
|
||||
match next_char {
|
||||
Some('.') => {}
|
||||
@ -609,7 +609,7 @@ fn tight<'a>(
|
||||
|
||||
let (input, tail) = opt(alt((many1(range_continuation), many1(dot_member))))(input)?;
|
||||
|
||||
let next_char = &input.fragment.chars().nth(0);
|
||||
let next_char = &input.fragment.chars().next();
|
||||
|
||||
if is_boundary(*next_char) {
|
||||
if let Some(tail) = tail {
|
||||
|
Reference in New Issue
Block a user