Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion rust/agama-lib/src/storage/client/iscsi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ impl<'a> ISCSIClient<'a> {
Ok(())
}

pub async fn get_node_proxy(&self, id: u32) -> Result<NodeProxy, ServiceError> {
pub async fn get_node_proxy(&'a self, id: u32) -> Result<NodeProxy<'a>, ServiceError> {
let proxy = NodeProxy::builder(&self.connection)
.path(format!("/org/opensuse/Agama/Storage1/iscsi_nodes/{}", id))?
.build()
Expand Down
6 changes: 3 additions & 3 deletions rust/agama-lib/src/storage/client/zfcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub struct ZFCPClient<'a> {
introspectable_proxy: IntrospectableProxy<'a>,
}

impl ZFCPClient<'_> {
impl<'a> ZFCPClient<'a> {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are both lifetime needed? I expect just one of them here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whichever you mean, I disagree:

impl ZFCPClient<'a>

error[E0261]: use of undeclared lifetime name 'a

impl<'a> ZFCPClient

error[E0726]: implicit elided lifetime not allowed here

impl<'a> ZFCPClient<'_>

This does compile but serves only to obscure the meaning.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in fact the third one is correct for me as it said impl use lifetime a, and let auto generate lifetime of struct itself. But as it has same lenght, it does not matter much for me.

pub async fn new(connection: Connection) -> Result<Self, ServiceError> {
let manager_proxy = ManagerProxy::new(&connection).await?;
let object_manager_proxy = ObjectManagerProxy::builder(&connection)
Expand Down Expand Up @@ -130,9 +130,9 @@ impl ZFCPClient<'_> {
}

async fn get_controller_proxy(
&self,
&'a self,
controller_id: &str,
) -> Result<ControllerProxy, ServiceError> {
) -> Result<ControllerProxy<'a>, ServiceError> {
let dbus = ControllerProxy::builder(&self.connection)
.path(ZFCP_CONTROLLER_PREFIX.to_string() + "/" + controller_id)?
.build()
Expand Down
5 changes: 4 additions & 1 deletion rust/zypp-agama/zypp-agama-sys/c-layer/callbacks.cxx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#include <boost/bind.hpp>
#include <boost/bind/bind.hpp>
#include <zypp/Callback.h>
#include <zypp/ZYppCallbacks.h>

#include "callbacks.h"

// _1
using namespace boost::placeholders;

struct ProgressReceive : zypp::callback::ReceiveReport<zypp::ProgressReport> {
ZyppProgressCallback callback;
void *user_data;
Expand Down
Loading