bump msrv to 1.63 (#5570)
* bump msrv to 1.63 * resolve new complex type clippy lints
This commit is contained in:
parent
bd14f5a72c
commit
e474779c87
10 changed files with 32 additions and 28 deletions
16
.github/workflows/build.yml
vendored
16
.github/workflows/build.yml
vendored
|
@ -10,19 +10,11 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
check:
|
check:
|
||||||
name: Check
|
name: Check (msrv)
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
rust: [stable, msrv]
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Use MSRV rust toolchain
|
|
||||||
if: matrix.rust == 'msrv'
|
|
||||||
run: cp .github/workflows/msrv-rust-toolchain.toml rust-toolchain.toml
|
|
||||||
|
|
||||||
- name: Install stable toolchain
|
- name: Install stable toolchain
|
||||||
uses: helix-editor/rust-toolchain@v1
|
uses: helix-editor/rust-toolchain@v1
|
||||||
with:
|
with:
|
||||||
|
@ -45,7 +37,7 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install stable toolchain
|
- name: Install stable toolchain
|
||||||
uses: dtolnay/rust-toolchain@1.61
|
uses: dtolnay/rust-toolchain@1.63
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
@ -74,7 +66,7 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install stable toolchain
|
- name: Install stable toolchain
|
||||||
uses: dtolnay/rust-toolchain@1.61
|
uses: dtolnay/rust-toolchain@1.63
|
||||||
with:
|
with:
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
|
|
||||||
|
@ -99,7 +91,7 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Install stable toolchain
|
- name: Install stable toolchain
|
||||||
uses: dtolnay/rust-toolchain@1.61
|
uses: dtolnay/rust-toolchain@1.63
|
||||||
|
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
|
3
.github/workflows/msrv-rust-toolchain.toml
vendored
3
.github/workflows/msrv-rust-toolchain.toml
vendored
|
@ -1,3 +0,0 @@
|
||||||
[toolchain]
|
|
||||||
channel = "1.61.0"
|
|
||||||
components = ["rustfmt", "rust-src"]
|
|
|
@ -73,13 +73,15 @@ use grep_searcher::{sinks, BinaryDetection, SearcherBuilder};
|
||||||
use ignore::{DirEntry, WalkBuilder, WalkState};
|
use ignore::{DirEntry, WalkBuilder, WalkState};
|
||||||
use tokio_stream::wrappers::UnboundedReceiverStream;
|
use tokio_stream::wrappers::UnboundedReceiverStream;
|
||||||
|
|
||||||
|
pub type OnKeyCallback = Box<dyn FnOnce(&mut Context, KeyEvent)>;
|
||||||
|
|
||||||
pub struct Context<'a> {
|
pub struct Context<'a> {
|
||||||
pub register: Option<char>,
|
pub register: Option<char>,
|
||||||
pub count: Option<NonZeroUsize>,
|
pub count: Option<NonZeroUsize>,
|
||||||
pub editor: &'a mut Editor,
|
pub editor: &'a mut Editor,
|
||||||
|
|
||||||
pub callback: Option<crate::compositor::Callback>,
|
pub callback: Option<crate::compositor::Callback>,
|
||||||
pub on_next_key_callback: Option<Box<dyn FnOnce(&mut Context, KeyEvent)>>,
|
pub on_next_key_callback: Option<OnKeyCallback>,
|
||||||
pub jobs: &'a mut Jobs,
|
pub jobs: &'a mut Jobs,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@ use helix_view::graphics::{CursorKind, Rect};
|
||||||
use tui::buffer::Buffer as Surface;
|
use tui::buffer::Buffer as Surface;
|
||||||
|
|
||||||
pub type Callback = Box<dyn FnOnce(&mut Compositor, &mut Context)>;
|
pub type Callback = Box<dyn FnOnce(&mut Compositor, &mut Context)>;
|
||||||
|
pub type SyncCallback = Box<dyn FnOnce(&mut Compositor, &mut Context) + Sync>;
|
||||||
|
|
||||||
// Cursive-inspired
|
// Cursive-inspired
|
||||||
pub enum EventResult {
|
pub enum EventResult {
|
||||||
|
|
|
@ -5,9 +5,12 @@ use crate::compositor::Compositor;
|
||||||
use futures_util::future::{BoxFuture, Future, FutureExt};
|
use futures_util::future::{BoxFuture, Future, FutureExt};
|
||||||
use futures_util::stream::{FuturesUnordered, StreamExt};
|
use futures_util::stream::{FuturesUnordered, StreamExt};
|
||||||
|
|
||||||
|
pub type EditorCompositorCallback = Box<dyn FnOnce(&mut Editor, &mut Compositor) + Send>;
|
||||||
|
pub type EditorCallback = Box<dyn FnOnce(&mut Editor) + Send>;
|
||||||
|
|
||||||
pub enum Callback {
|
pub enum Callback {
|
||||||
EditorCompositor(Box<dyn FnOnce(&mut Editor, &mut Compositor) + Send>),
|
EditorCompositor(EditorCompositorCallback),
|
||||||
Editor(Box<dyn FnOnce(&mut Editor) + Send>),
|
Editor(EditorCallback),
|
||||||
}
|
}
|
||||||
|
|
||||||
pub type JobFuture = BoxFuture<'static, anyhow::Result<Option<Callback>>>;
|
pub type JobFuture = BoxFuture<'static, anyhow::Result<Option<Callback>>>;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
commands,
|
commands::{self, OnKeyCallback},
|
||||||
compositor::{Component, Context, Event, EventResult},
|
compositor::{Component, Context, Event, EventResult},
|
||||||
job::{self, Callback},
|
job::{self, Callback},
|
||||||
key,
|
key,
|
||||||
|
@ -37,7 +37,7 @@ use super::{document::LineDecoration, lsp::SignatureHelp};
|
||||||
|
|
||||||
pub struct EditorView {
|
pub struct EditorView {
|
||||||
pub keymaps: Keymaps,
|
pub keymaps: Keymaps,
|
||||||
on_next_key: Option<Box<dyn FnOnce(&mut commands::Context, KeyEvent)>>,
|
on_next_key: Option<OnKeyCallback>,
|
||||||
pseudo_pending: Vec<KeyEvent>,
|
pseudo_pending: Vec<KeyEvent>,
|
||||||
last_insert: (commands::MappableCommand, Vec<InsertEvent>),
|
last_insert: (commands::MappableCommand, Vec<InsertEvent>),
|
||||||
pub(crate) completion: Option<Completion>,
|
pub(crate) completion: Option<Completion>,
|
||||||
|
|
|
@ -43,6 +43,8 @@ impl Item for PathBuf {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub type MenuCallback<T> = Box<dyn Fn(&mut Editor, Option<&T>, MenuEvent)>;
|
||||||
|
|
||||||
pub struct Menu<T: Item> {
|
pub struct Menu<T: Item> {
|
||||||
options: Vec<T>,
|
options: Vec<T>,
|
||||||
editor_data: T::Data,
|
editor_data: T::Data,
|
||||||
|
@ -55,7 +57,7 @@ pub struct Menu<T: Item> {
|
||||||
|
|
||||||
widths: Vec<Constraint>,
|
widths: Vec<Constraint>,
|
||||||
|
|
||||||
callback_fn: Box<dyn Fn(&mut Editor, Option<&T>, MenuEvent)>,
|
callback_fn: MenuCallback<T>,
|
||||||
|
|
||||||
scroll: usize,
|
scroll: usize,
|
||||||
size: (u16, u16),
|
size: (u16, u16),
|
||||||
|
|
|
@ -70,6 +70,8 @@ impl From<DocumentId> for PathOrId {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type FileCallback<T> = Box<dyn Fn(&Editor, &T) -> Option<FileLocation>>;
|
||||||
|
|
||||||
/// File path and range of lines (used to align and highlight lines)
|
/// File path and range of lines (used to align and highlight lines)
|
||||||
pub type FileLocation = (PathOrId, Option<(usize, usize)>);
|
pub type FileLocation = (PathOrId, Option<(usize, usize)>);
|
||||||
|
|
||||||
|
@ -80,7 +82,7 @@ pub struct FilePicker<T: Item> {
|
||||||
preview_cache: HashMap<PathBuf, CachedPreview>,
|
preview_cache: HashMap<PathBuf, CachedPreview>,
|
||||||
read_buffer: Vec<u8>,
|
read_buffer: Vec<u8>,
|
||||||
/// Given an item in the picker, return the file path and line number to display.
|
/// Given an item in the picker, return the file path and line number to display.
|
||||||
file_fn: Box<dyn Fn(&Editor, &T) -> Option<FileLocation>>,
|
file_fn: FileCallback<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum CachedPreview {
|
pub enum CachedPreview {
|
||||||
|
@ -394,6 +396,8 @@ impl Ord for PickerMatch {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type PickerCallback<T> = Box<dyn Fn(&mut Context, &T, Action)>;
|
||||||
|
|
||||||
pub struct Picker<T: Item> {
|
pub struct Picker<T: Item> {
|
||||||
options: Vec<T>,
|
options: Vec<T>,
|
||||||
editor_data: T::Data,
|
editor_data: T::Data,
|
||||||
|
@ -415,7 +419,7 @@ pub struct Picker<T: Item> {
|
||||||
/// Constraints for tabular formatting
|
/// Constraints for tabular formatting
|
||||||
widths: Vec<Constraint>,
|
widths: Vec<Constraint>,
|
||||||
|
|
||||||
callback_fn: Box<dyn Fn(&mut Context, &T, Action)>,
|
callback_fn: PickerCallback<T>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T: Item> Picker<T> {
|
impl<T: Item> Picker<T> {
|
||||||
|
|
|
@ -14,8 +14,11 @@ use helix_view::{
|
||||||
Editor,
|
Editor,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub type Completion = (RangeFrom<usize>, Cow<'static, str>);
|
|
||||||
type PromptCharHandler = Box<dyn Fn(&mut Prompt, char, &Context)>;
|
type PromptCharHandler = Box<dyn Fn(&mut Prompt, char, &Context)>;
|
||||||
|
pub type Completion = (RangeFrom<usize>, Cow<'static, str>);
|
||||||
|
type CompletionFn = Box<dyn FnMut(&Editor, &str) -> Vec<Completion>>;
|
||||||
|
type CallbackFn = Box<dyn FnMut(&mut Context, &str, PromptEvent)>;
|
||||||
|
pub type DocFn = Box<dyn Fn(&str) -> Option<Cow<str>>>;
|
||||||
|
|
||||||
pub struct Prompt {
|
pub struct Prompt {
|
||||||
prompt: Cow<'static, str>,
|
prompt: Cow<'static, str>,
|
||||||
|
@ -25,9 +28,9 @@ pub struct Prompt {
|
||||||
selection: Option<usize>,
|
selection: Option<usize>,
|
||||||
history_register: Option<char>,
|
history_register: Option<char>,
|
||||||
history_pos: Option<usize>,
|
history_pos: Option<usize>,
|
||||||
completion_fn: Box<dyn FnMut(&Editor, &str) -> Vec<Completion>>,
|
completion_fn: CompletionFn,
|
||||||
callback_fn: Box<dyn FnMut(&mut Context, &str, PromptEvent)>,
|
callback_fn: CallbackFn,
|
||||||
pub doc_fn: Box<dyn Fn(&str) -> Option<Cow<str>>>,
|
pub doc_fn: DocFn,
|
||||||
next_char_handler: Option<PromptCharHandler>,
|
next_char_handler: Option<PromptCharHandler>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.61.0"
|
channel = "1.63.0"
|
||||||
components = ["rustfmt", "rust-src"]
|
components = ["rustfmt", "rust-src"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue