fix clippy in all examples.

added a ignore for plugins, as we cannot remove the `Result<>` type, it is necessary
This commit is contained in:
Marcel Märtens 2021-01-13 14:42:49 +01:00
parent 68be467138
commit 6390e758d4
3 changed files with 6 additions and 8 deletions

View File

@ -117,6 +117,7 @@ impl Server {
trace!("Stop connect_manager");
}
#[allow(clippy::eval_order_dependence)]
async fn loop_participant(&self, p: Participant) {
if let (Ok(cmd_out), Ok(file_out), Ok(cmd_in), Ok(file_in)) = (
p.open(15, Promises::ORDERED | Promises::CONSISTENCY).await,

View File

@ -14,6 +14,7 @@ pub fn event_handler(_args: TokenStream, item: TokenStream) -> TokenStream {
let fn_return = sig.output; // comma separated args
let out: proc_macro2::TokenStream = quote! {
#[allow(clippy::unnecessary_wraps)]
#[no_mangle]
pub fn #fn_name(intern__ptr: i32, intern__len: u32) -> i32 {
let input = ::veloren_plugin_rt::read_input(intern__ptr,intern__len).unwrap();

View File

@ -375,20 +375,16 @@ fn main() {
if is_camera {
focus.z += spd * scale;
samples_changed = true;
} else {
if (scale * 2.0).is_normal() {
scale *= 2.0;
}
} else if (scale * 2.0).is_normal() {
scale *= 2.0;
}
}
if win.is_key_down(minifb::Key::F) {
if is_camera {
focus.z -= spd * scale;
samples_changed = true;
} else {
if (scale / 2.0).is_normal() {
scale /= 2.0;
}
} else if (scale / 2.0).is_normal() {
scale /= 2.0;
}
}