fixed compiler warnings

This commit is contained in:
2026-03-07 00:37:51 -05:00
parent fe9fd5c797
commit ae73969969
10 changed files with 53 additions and 54 deletions

View File

@@ -368,6 +368,25 @@ pub fn map(node: Node) -> ShResult<()> {
Ok(())
}
pub fn get_map_opts(opts: Vec<Opt>) -> MapOpts {
let mut map_opts = MapOpts {
flags: MapFlags::empty(),
};
for opt in opts {
match opt {
Opt::Short('r') => map_opts.flags |= MapFlags::REMOVE,
Opt::Short('j') => map_opts.flags |= MapFlags::JSON,
Opt::Short('k') => map_opts.flags |= MapFlags::KEYS,
Opt::Short('l') => map_opts.flags |= MapFlags::LOCAL,
Opt::Long(ref s) if s == "pretty" => map_opts.flags |= MapFlags::PRETTY,
Opt::Short('F') => map_opts.flags |= MapFlags::FUNC,
_ => unreachable!(),
}
}
map_opts
}
#[cfg(test)]
mod tests {
use super::{MapNode, MapFlags, get_map_opts};
@@ -601,22 +620,3 @@ mod tests {
assert_eq!(state::get_status(), 0);
}
}
pub fn get_map_opts(opts: Vec<Opt>) -> MapOpts {
let mut map_opts = MapOpts {
flags: MapFlags::empty(),
};
for opt in opts {
match opt {
Opt::Short('r') => map_opts.flags |= MapFlags::REMOVE,
Opt::Short('j') => map_opts.flags |= MapFlags::JSON,
Opt::Short('k') => map_opts.flags |= MapFlags::KEYS,
Opt::Short('l') => map_opts.flags |= MapFlags::LOCAL,
Opt::Long(ref s) if s == "pretty" => map_opts.flags |= MapFlags::PRETTY,
Opt::Short('F') => map_opts.flags |= MapFlags::FUNC,
_ => unreachable!(),
}
}
map_opts
}