Skip to content

Commit

Permalink
HelloRes: fix mistake in struct fields
Browse files Browse the repository at this point in the history
  • Loading branch information
naim94a committed Mar 18, 2024
1 parent a36bafc commit bf4251d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
13 changes: 9 additions & 4 deletions common/src/rpc/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,17 @@ pub struct DelHistoryResult {
pub deleted_mds: u32,
}

#[derive(Debug, Deserialize, Serialize)]
pub struct HelloResult<'a> {
#[derive(Debug, Deserialize, Serialize, Default)]
pub struct LicenseInfo<'a> {
pub id: Cow<'a, str>,
pub username: Cow<'a, str>,
pub name: Cow<'a, str>,
pub email: Cow<'a, str>,
pub lic_id: Cow<'a, str>,
}

#[derive(Debug, Deserialize, Serialize, Default)]
pub struct HelloResult<'a> {
pub license_info: LicenseInfo<'a>,
pub username: Cow<'a, str>,
pub karma: u32,
pub last_active: u64,
pub features: u32,
Expand Down
10 changes: 1 addition & 9 deletions lumen/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,7 @@ async fn handle_client<S: AsyncRead + AsyncWrite + Unpin>(
features |= 0x02;
}

rpc::RpcMessage::HelloResult(HelloResult {
id: "".into(),
username: "".into(),
email: "".into(),
lic_id: "".into(),
karma: 0,
last_active: 0,
features,
})
rpc::RpcMessage::HelloResult(HelloResult { features, ..Default::default() })
},
};
resp.async_write(&mut stream).await?;
Expand Down

0 comments on commit bf4251d

Please sign in to comment.