Skip to content

Commit 726a5a5

Browse files
committed
Derive Default for RpcMode in gdnative-derive
1 parent 268b954 commit 726a5a5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

gdnative-derive/src/syntax/rpc_mode.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use quote::{quote, ToTokens};
22

3-
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
3+
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
44
pub enum RpcMode {
5+
#[default]
56
Disabled,
67
Remote,
78
RemoteSync,
@@ -26,12 +27,6 @@ impl RpcMode {
2627
}
2728
}
2829

29-
impl Default for RpcMode {
30-
fn default() -> Self {
31-
RpcMode::Disabled
32-
}
33-
}
34-
3530
impl ToTokens for RpcMode {
3631
fn to_tokens(&self, tokens: &mut proc_macro2::TokenStream) {
3732
match self {

0 commit comments

Comments
 (0)