From 85362f33d81ebdc1cd355454be2494b9286e80be Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 27 Sep 2021 09:04:34 +0300 Subject: Avoid naming field setting it from variable of the same name When creating a struct with a field foo, using a variable also named foo, it's not necessary to name the field explicitly. Thus, instead of: Self { foo: foo } use this: Self { foo } The shorter form is more idiomatic and thus less confusing to experienced Rust programmers. This was found by the clippy lint redundant_field_names: https://rust-lang.github.io/rust-clippy/master/index.html#redundant_field_names Sponsored-by: author --- ffi/src/core.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ffi') diff --git a/ffi/src/core.rs b/ffi/src/core.rs index d9bccd3b..147b9eba 100644 --- a/ffi/src/core.rs +++ b/ffi/src/core.rs @@ -52,7 +52,7 @@ pub struct Context { impl Context { fn new(c: sequoia_ipc::Context) -> Self { - Context{c: c, e: ptr::null_mut()} + Context{c, e: ptr::null_mut()} } pub(crate) fn errp(&mut self) -> &mut *mut crate::error::Error { -- cgit v1.2.3