mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-12-19 05:05:49 +08:00
Clean up some stale comments
This commit is contained in:
parent
fcf8ed0628
commit
0b68fbfd85
|
@ -83,7 +83,7 @@ pub fn source(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O
|
||||||
Some(func_filename.clone()),
|
Some(func_filename.clone()),
|
||||||
);
|
);
|
||||||
|
|
||||||
// Construct argv from our null-terminated list.
|
// Construct argv for the sourced file from our remaining args.
|
||||||
// This is slightly subtle. If this is a bare `source` with no args then `argv + optind` already
|
// This is slightly subtle. If this is a bare `source` with no args then `argv + optind` already
|
||||||
// points to the end of argv. Otherwise we want to skip the file name to get to the args if any.
|
// points to the end of argv. Otherwise we want to skip the file name to get to the args if any.
|
||||||
let remaining_args = &args[optind + if argc == optind { 0 } else { 1 }..];
|
let remaining_args = &args[optind + if argc == optind { 0 } else { 1 }..];
|
||||||
|
@ -105,7 +105,5 @@ pub fn source(parser: &Parser, streams: &mut IoStreams, args: &mut [&wstr]) -> O
|
||||||
retval = parser.get_last_status();
|
retval = parser.get_last_status();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Do not close fd after calling reader_read. reader_read automatically closes it before calling
|
|
||||||
// eval.
|
|
||||||
Some(retval)
|
Some(retval)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1942,8 +1942,8 @@ pub trait Named {
|
||||||
fn name(&self) -> &'static wstr;
|
fn name(&self) -> &'static wstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return a pointer to the first entry with the given name, assuming the entries are sorted by
|
/// Return a reference to the first entry with the given name, assuming the entries are sorted by
|
||||||
/// name. Return nullptr if not found.
|
/// name. Return None if not found.
|
||||||
pub fn get_by_sorted_name<T: Named>(name: &wstr, vals: &'static [T]) -> Option<&'static T> {
|
pub fn get_by_sorted_name<T: Named>(name: &wstr, vals: &'static [T]) -> Option<&'static T> {
|
||||||
match vals.binary_search_by_key(&name, |val| val.name()) {
|
match vals.binary_search_by_key(&name, |val| val.name()) {
|
||||||
Ok(index) => Some(&vals[index]),
|
Ok(index) => Some(&vals[index]),
|
||||||
|
|
|
@ -860,7 +860,7 @@ impl Parser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Pushes a new block. Returns a pointer to the block, stored in the parser.
|
/// Pushes a new block. Returns an id (index) of the block, which is stored in the parser.
|
||||||
pub fn push_block(&self, mut block: Block) -> BlockId {
|
pub fn push_block(&self, mut block: Block) -> BlockId {
|
||||||
block.src_lineno = self.get_lineno();
|
block.src_lineno = self.get_lineno();
|
||||||
block.src_filename = self.current_filename();
|
block.src_filename = self.current_filename();
|
||||||
|
|
|
@ -1363,8 +1363,7 @@ impl LayoutCache {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Finds the layout for a prompt, promoting it to the front. Returns nullptr if not found.
|
/// Finds the layout for a prompt, promoting it to the front. Returns whether this was found.
|
||||||
/// Note this points into our cache; do not modify the cache while the pointer lives.
|
|
||||||
/// Exposed for testing.
|
/// Exposed for testing.
|
||||||
pub fn find_prompt_layout(
|
pub fn find_prompt_layout(
|
||||||
&mut self,
|
&mut self,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user