mirror of
https://github.com/noib3/nvim-oxi.git
synced 2025-08-04 19:08:31 +00:00
refactor: make api::get_mode()
infallible (#247)
This commit is contained in:
parent
d027f99643
commit
1f10c8fac2
3 changed files with 10 additions and 3 deletions
|
@ -379,8 +379,10 @@ pub fn get_mark(
|
|||
/// [`GotMode`] is `true` if Neovim is waiting for input.
|
||||
///
|
||||
/// [1]: https://neovim.io/doc/user/api.html#nvim_get_mode()
|
||||
pub fn get_mode() -> Result<GotMode> {
|
||||
unsafe { nvim_get_mode(types::arena()) }.try_into().map_err(Into::into)
|
||||
pub fn get_mode() -> GotMode {
|
||||
unsafe { nvim_get_mode(types::arena()) }
|
||||
.try_into()
|
||||
.expect("couldn't get mode")
|
||||
}
|
||||
|
||||
/// Binding to [`nvim_get_proc()`][1].
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue