mirror of
https://github.com/noib3/nvim-oxi.git
synced 2025-08-04 19:08:31 +00:00
Fix Clippy
This commit is contained in:
parent
f1e01d0fa1
commit
d7334112a0
8 changed files with 15 additions and 21 deletions
|
@ -166,7 +166,7 @@ impl Buffer {
|
|||
types::ObjectKind::Nil => {
|
||||
return Ret::from_object(Object::nil()).map_err(Into::into)
|
||||
},
|
||||
other => panic!("Unexpected object kind: {:?}", other),
|
||||
other => panic!("Unexpected object kind: {other:?}"),
|
||||
};
|
||||
|
||||
unsafe {
|
||||
|
|
|
@ -123,7 +123,7 @@ impl Window {
|
|||
types::ObjectKind::Nil => {
|
||||
return Ret::from_object(Object::nil()).map_err(Into::into)
|
||||
},
|
||||
other => panic!("Unexpected object kind: {:?}", other),
|
||||
other => panic!("Unexpected object kind: {other:?}"),
|
||||
};
|
||||
|
||||
unsafe {
|
||||
|
|
|
@ -47,8 +47,7 @@ impl Error {
|
|||
Self::PopError {
|
||||
ty,
|
||||
message: Some(format!(
|
||||
"expected a {}, found a {} instead",
|
||||
expected, found
|
||||
"expected a {expected}, found a {found} instead",
|
||||
)),
|
||||
}
|
||||
}
|
||||
|
@ -62,10 +61,7 @@ impl Error {
|
|||
|
||||
Self::PopError {
|
||||
ty: expected,
|
||||
message: Some(format!(
|
||||
"expected {}, got {} instead",
|
||||
expected, got
|
||||
)),
|
||||
message: Some(format!("expected {expected}, got {got} instead",)),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -523,7 +523,7 @@ impl BuilderAttribute {
|
|||
} else if ident == "setter" {
|
||||
is_setter = true;
|
||||
} else {
|
||||
let msg = format!("unknown attribute `{}`", ident);
|
||||
let msg = format!("unknown attribute `{ident}`");
|
||||
return Err(Error::new_spanned(ident, msg));
|
||||
}
|
||||
|
||||
|
@ -615,9 +615,8 @@ fn is_valid_combination(attrs: &[BuilderAttribute]) -> Result<()> {
|
|||
BuilderAttribute::Inline(inline) => {
|
||||
if !inline.contains(INLINE_PLACEHOLDER) {
|
||||
let _msg = format!(
|
||||
"expected `{}` in the expression of the `inline` \
|
||||
attribute",
|
||||
INLINE_PLACEHOLDER,
|
||||
"expected `{INLINE_PLACEHOLDER}` in the expression \
|
||||
of the `inline` attribute",
|
||||
);
|
||||
todo!();
|
||||
}
|
||||
|
|
|
@ -46,10 +46,9 @@ pub fn test(attrs: TokenStream, item: TokenStream) -> TokenStream {
|
|||
None => quote! { ::core::option::Option::None },
|
||||
};
|
||||
|
||||
let maybe_ignore_err =
|
||||
should_panic.then(|| quote!(let _ = )).unwrap_or_default();
|
||||
let maybe_ignore_err = should_panic.then(|| quote!(let _ = ));
|
||||
|
||||
let maybe_semicolon = should_panic.then(|| quote!(;)).unwrap_or_default();
|
||||
let maybe_semicolon = should_panic.then(|| quote!(;));
|
||||
|
||||
#[cfg(feature = "test-terminator")]
|
||||
let plugin_body = match &sig.inputs.first() {
|
||||
|
|
|
@ -28,7 +28,7 @@ impl core::fmt::Debug for Dictionary {
|
|||
let num_elements = self.len();
|
||||
|
||||
for (idx, (key, value)) in self.iter().enumerate() {
|
||||
write!(f, "{}: {:?}", key, value)?;
|
||||
write!(f, "{key}: {value:?}")?;
|
||||
|
||||
if idx + 1 < num_elements {
|
||||
write!(f, ", ")?;
|
||||
|
|
|
@ -105,7 +105,7 @@ impl core::fmt::Debug for Object {
|
|||
|
||||
ObjectKind::LuaRef => {
|
||||
let luaref = unsafe { self.data.luaref };
|
||||
return write!(f, "Object(LuaRef({}))", luaref);
|
||||
return write!(f, "Object(LuaRef({luaref}))");
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -778,7 +778,7 @@ impl Poppable for Object {
|
|||
|
||||
Err(lua::Error::pop_error(
|
||||
"Object",
|
||||
format!("unexpected value of type {}", typename),
|
||||
format!("unexpected value of type {typename}"),
|
||||
))
|
||||
},
|
||||
|
||||
|
|
|
@ -41,12 +41,12 @@ pub enum DeserializeError {
|
|||
impl fmt::Display for DeserializeError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Custom { msg } => write!(f, "{}", msg),
|
||||
Self::Custom { msg } => write!(f, "{msg}"),
|
||||
Self::DuplicateField { field } => {
|
||||
write!(f, "duplicate field '{}'", field)
|
||||
write!(f, "duplicate field '{field}'")
|
||||
},
|
||||
Self::MissingField { field } => {
|
||||
write!(f, "missing field '{}'", field)
|
||||
write!(f, "missing field '{field}'")
|
||||
},
|
||||
Self::UnknownField { field, expected } => {
|
||||
write!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue