aboutsummaryrefslogtreecommitdiff
path: root/helix-term/src/commands
diff options
context:
space:
mode:
Diffstat (limited to 'helix-term/src/commands')
-rw-r--r--helix-term/src/commands/dap.rs4
-rw-r--r--helix-term/src/commands/typed.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs
index e9fde476..dec25cbd 100644
--- a/helix-term/src/commands/dap.rs
+++ b/helix-term/src/commands/dap.rs
@@ -78,7 +78,7 @@ fn thread_picker(
})
.with_preview(move |editor, thread| {
let frames = editor.debugger.as_ref()?.stack_frames.get(&thread.id)?;
- let frame = frames.get(0)?;
+ let frame = frames.first()?;
let path = frame.source.as_ref()?.path.clone()?;
let pos = Some((
frame.line.saturating_sub(1),
@@ -166,7 +166,7 @@ pub fn dap_start_impl(
// TODO: avoid refetching all of this... pass a config in
let template = match name {
Some(name) => config.templates.iter().find(|t| t.name == name),
- None => config.templates.get(0),
+ None => config.templates.first(),
}
.ok_or_else(|| anyhow!("No debug config with given name"))?;
diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs
index b13af03a..eb88e041 100644
--- a/helix-term/src/commands/typed.rs
+++ b/helix-term/src/commands/typed.rs
@@ -483,7 +483,7 @@ fn set_indent_style(
}
// Attempt to parse argument as an indent style.
- let style = match args.get(0) {
+ let style = match args.first() {
Some(arg) if "tabs".starts_with(&arg.to_lowercase()) => Some(Tabs),
Some(Cow::Borrowed("0")) => Some(Tabs),
Some(arg) => arg
@@ -535,7 +535,7 @@ fn set_line_ending(
}
let arg = args
- .get(0)
+ .first()
.context("argument missing")?
.to_ascii_lowercase();
@@ -2078,7 +2078,7 @@ fn reflow(
// - The configured text-width for this language in languages.toml
// - The configured text-width in the config.toml
let text_width: usize = args
- .get(0)
+ .first()
.map(|num| num.parse::<usize>())
.transpose()?
.or_else(|| doc.language_config().and_then(|config| config.text_width))