Skip to content

Commit

Permalink
all: Port to satisfy latest clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
zeenix committed Dec 2, 2024
1 parent 20a96b3 commit ba1975e
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 29 deletions.
8 changes: 4 additions & 4 deletions examples/more/src/org_example_more.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub trait VarlinkCallError: varlink::CallTrait {
))
}
}
impl<'a> VarlinkCallError for varlink::Call<'a> {}
impl VarlinkCallError for varlink::Call<'_> {}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct r#State {
pub r#start: Option<bool>,
Expand All @@ -158,7 +158,7 @@ pub trait Call_Ping: VarlinkCallError {
self.reply_struct(Ping_Reply { r#pong }.into())
}
}
impl<'a> Call_Ping for varlink::Call<'a> {}
impl Call_Ping for varlink::Call<'_> {}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct StopServing_Reply {}
impl varlink::VarlinkReply for StopServing_Reply {}
Expand All @@ -170,7 +170,7 @@ pub trait Call_StopServing: VarlinkCallError {
self.reply_struct(varlink::Reply::parameters(None))
}
}
impl<'a> Call_StopServing for varlink::Call<'a> {}
impl Call_StopServing for varlink::Call<'_> {}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct TestMore_Reply {
pub r#state: State,
Expand All @@ -186,7 +186,7 @@ pub trait Call_TestMore: VarlinkCallError {
self.reply_struct(TestMore_Reply { r#state }.into())
}
}
impl<'a> Call_TestMore for varlink::Call<'a> {}
impl Call_TestMore for varlink::Call<'_> {}
#[allow(dead_code)]
pub trait VarlinkInterface {
fn ping(&self, call: &mut dyn Call_Ping, r#ping: String) -> varlink::Result<()>;
Expand Down
6 changes: 3 additions & 3 deletions examples/ping/src/org_example_ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub trait VarlinkCallError: varlink::CallTrait {
))
}
}
impl<'a> VarlinkCallError for varlink::Call<'a> {}
impl VarlinkCallError for varlink::Call<'_> {}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct PingError_Args {
pub r#parameter: i64,
Expand All @@ -152,7 +152,7 @@ pub trait Call_Ping: VarlinkCallError {
self.reply_struct(Ping_Reply { r#pong }.into())
}
}
impl<'a> Call_Ping for varlink::Call<'a> {}
impl Call_Ping for varlink::Call<'_> {}
#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct Upgrade_Reply {}
impl varlink::VarlinkReply for Upgrade_Reply {}
Expand All @@ -164,7 +164,7 @@ pub trait Call_Upgrade: VarlinkCallError {
self.reply_struct(varlink::Reply::parameters(None))
}
}
impl<'a> Call_Upgrade for varlink::Call<'a> {}
impl Call_Upgrade for varlink::Call<'_> {}
#[allow(dead_code)]
pub trait VarlinkInterface {
fn ping(&self, call: &mut dyn Call_Ping, r#ping: String) -> varlink::Result<()>;
Expand Down
4 changes: 2 additions & 2 deletions varlink/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ pub trait CallTrait {
}
}

impl<'a> CallTrait for Call<'a> {
impl CallTrait for Call<'_> {
fn reply_struct(&mut self, mut reply: Reply) -> Result<()> {
if self.continues && (!self.wants_more()) {
return Err(context!(ErrorKind::CallContinuesMismatch));
Expand Down Expand Up @@ -1512,6 +1512,6 @@ impl ConnectionHandler for VarlinkService {
}
}

return Ok((bufreader.buffer().to_vec(), upgraded_iface));
Ok((bufreader.buffer().to_vec(), upgraded_iface))
}
}
36 changes: 18 additions & 18 deletions varlink_parser/src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub trait FormatColored {
fn get_multiline_colored(&self, indent: usize, max: usize) -> String;
}

impl<'a> Format for VTypeExt<'a> {
impl Format for VTypeExt<'_> {
fn get_oneline(&self) -> String {
match *self {
VTypeExt::Plain(VType::Bool) => "bool".into(),
Expand Down Expand Up @@ -46,7 +46,7 @@ impl<'a> Format for VTypeExt<'a> {
}
}

impl<'a> FormatColored for VTypeExt<'a> {
impl FormatColored for VTypeExt<'_> {
fn get_oneline_colored(&self) -> String {
match *self {
VTypeExt::Plain(VType::Bool) => "bool".cyan().to_string(),
Expand Down Expand Up @@ -83,13 +83,13 @@ impl<'a> FormatColored for VTypeExt<'a> {
}
}

impl<'a> fmt::Display for VTypeExt<'a> {
impl fmt::Display for VTypeExt<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.get_oneline())
}
}

impl<'a> Format for VStructOrEnum<'a> {
impl Format for VStructOrEnum<'_> {
fn get_oneline(&self) -> String {
match *self {
VStructOrEnum::VStruct(ref v) => v.get_oneline(),
Expand All @@ -105,7 +105,7 @@ impl<'a> Format for VStructOrEnum<'a> {
}
}

impl<'a> FormatColored for VStructOrEnum<'a> {
impl FormatColored for VStructOrEnum<'_> {
fn get_oneline_colored(&self) -> String {
match *self {
VStructOrEnum::VStruct(ref v) => v.get_oneline_colored(),
Expand All @@ -121,13 +121,13 @@ impl<'a> FormatColored for VStructOrEnum<'a> {
}
}

impl<'a> fmt::Display for VStructOrEnum<'a> {
impl fmt::Display for VStructOrEnum<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.get_oneline())
}
}

impl<'a> Format for Argument<'a> {
impl Format for Argument<'_> {
fn get_oneline(&self) -> String {
format!("{}: {}", self.name, self.vtype)
}
Expand All @@ -137,7 +137,7 @@ impl<'a> Format for Argument<'a> {
}
}

impl<'a> FormatColored for Argument<'a> {
impl FormatColored for Argument<'_> {
fn get_oneline_colored(&self) -> String {
format!("{}: {}", self.name, self.vtype.get_oneline_colored())
}
Expand All @@ -151,13 +151,13 @@ impl<'a> FormatColored for Argument<'a> {
}
}

impl<'a> fmt::Display for Argument<'a> {
impl fmt::Display for Argument<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.get_oneline())
}
}

impl<'a> fmt::Display for VStruct<'a> {
impl fmt::Display for VStruct<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "(")?;
let mut iter = self.elts.iter();
Expand All @@ -171,7 +171,7 @@ impl<'a> fmt::Display for VStruct<'a> {
}
}

impl<'a> Format for VStruct<'a> {
impl Format for VStruct<'_> {
fn get_oneline(&self) -> String {
let mut f = String::new();

Expand Down Expand Up @@ -224,7 +224,7 @@ impl<'a> Format for VStruct<'a> {
}
}

impl<'a> FormatColored for VStruct<'a> {
impl FormatColored for VStruct<'_> {
fn get_oneline_colored(&self) -> String {
let mut f = String::new();

Expand Down Expand Up @@ -287,13 +287,13 @@ impl<'a> FormatColored for VStruct<'a> {
}
}

impl<'a> fmt::Display for VEnum<'a> {
impl fmt::Display for VEnum<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.get_oneline())
}
}

impl<'a> Format for VEnum<'a> {
impl Format for VEnum<'_> {
fn get_oneline(&self) -> String {
let mut f = String::new();

Expand Down Expand Up @@ -325,7 +325,7 @@ impl<'a> Format for VEnum<'a> {
}
}

impl<'a> FormatColored for VEnum<'a> {
impl FormatColored for VEnum<'_> {
fn get_oneline_colored(&self) -> String {
self.get_oneline()
}
Expand All @@ -335,13 +335,13 @@ impl<'a> FormatColored for VEnum<'a> {
}
}

impl<'a> fmt::Display for IDL<'a> {
impl fmt::Display for IDL<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.write_str(&self.get_multiline(0, 80))
}
}

impl<'a> Format for IDL<'a> {
impl Format for IDL<'_> {
fn get_oneline(&self) -> String {
let mut f = String::new();

Expand Down Expand Up @@ -542,7 +542,7 @@ impl<'a> Format for IDL<'a> {
}
}

impl<'a> FormatColored for IDL<'a> {
impl FormatColored for IDL<'_> {
fn get_oneline_colored(&self) -> String {
let mut f = String::new();

Expand Down
4 changes: 2 additions & 2 deletions varlink_stdinterfaces/src/org_varlink_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ pub trait Call_GetInfo: varlink::CallTrait {
}
}

impl<'a> Call_GetInfo for varlink::Call<'a> {}
impl Call_GetInfo for varlink::Call<'_> {}

#[derive(Serialize, Deserialize, Debug, PartialEq, Clone)]
pub struct GetInterfaceDescription_Reply {
Expand All @@ -258,7 +258,7 @@ pub trait Call_GetInterfaceDescription: varlink::CallTrait {
}
}

impl<'a> Call_GetInterfaceDescription for varlink::Call<'a> {}
impl Call_GetInterfaceDescription for varlink::Call<'_> {}

pub trait VarlinkInterface {
fn get_info(&self, call: &mut dyn Call_GetInfo) -> varlink::Result<()>;
Expand Down

0 comments on commit ba1975e

Please sign in to comment.