From 46931b154219cc3bfce9d16c0cd8887ee089c89a Mon Sep 17 00:00:00 2001 From: Marie Ramlow Date: Tue, 3 Oct 2023 22:43:36 +0200 Subject: [PATCH] fix: return a String instead of a PathBuf in nvim_buf_get_name --- crates/oxi-api/src/buffer.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/oxi-api/src/buffer.rs b/crates/oxi-api/src/buffer.rs index 6eabe30c..6229b306 100644 --- a/crates/oxi-api/src/buffer.rs +++ b/crates/oxi-api/src/buffer.rs @@ -1,6 +1,6 @@ use std::fmt; use std::ops::RangeBounds; -use std::path::{Path, PathBuf}; +use std::path::Path; use std::result::Result as StdResult; use oxi_luajit::{self as lua, Poppable, Pushable}; @@ -365,15 +365,15 @@ impl Buffer { /// Binding to [`nvim_buf_get_name()`][1]. /// - /// Returns the full filepath of the buffer. + /// Returns the name of the buffer. /// /// [1]: https://neovim.io/doc/user/api.html#nvim_buf_get_name() - pub fn get_name(&self) -> Result { + pub fn get_name(&self) -> Result { let mut err = nvim::Error::new(); let name = unsafe { nvim_buf_get_name(self.0, core::ptr::null_mut(), &mut err) }; - choose!(err, Ok(name.into())) + choose!(err, Ok(name)) } /// Binding to [`nvim_buf_get_offset()`][1].