Skip to content

Commit

Permalink
fix(plugin): supress intended clippy warnings
Browse files Browse the repository at this point in the history
This commit:
1- handles the Err variant in 2 statements in coffee.rs
2- supresses 2 clippy warnings that are not mistakes as per the discussion in discord
3- removes redundant root_path from install_plugin_in_two_networks test

Signed-off-by: Tarek <tareknaser360@gmail.com>
  • Loading branch information
tareknaser committed Jul 20, 2023
1 parent a84c842 commit 289f7c0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions coffee_core/src/coffee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,26 +90,26 @@ impl CoffeeManager {
/// when coffee is configured, run an inventory to collect all the necessary information
/// about the coffee ecosystem.
async fn inventory(&mut self) -> Result<(), CoffeeError> {
self.storage
let _ = self
.storage
.load::<CoffeeStorageInfo>(&self.config.network)
.await
.and_then(|store| {
.map(|store| {
self.config = store.config;
Ok(())
});
// FIXME: check if this exist in a better wai
self.storage
let _ = self
.storage
.load::<HashMap<RepoName, RepositoryInfo>>("repositories")
.await
.and_then(|item| {
.map(|item| {
log::debug!("repositories in store {:?}", item);
item.iter().for_each(|repo| match repo.1.kind {
Kind::Git => {
let repo = Github::from(repo.1);
self.repos.insert(repo.name(), Box::new(repo));
}
});
Ok(())
});

if let Err(err) = self.coffee_cln_config.parse() {
Expand Down
1 change: 1 addition & 0 deletions coffee_plugin/src/plugin/plugin_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ impl CoffeeRemote {
}
}

#[allow(clippy::await_holding_lock)]
impl RPCCommand<State> for CoffeeRemote {
fn call<'c>(
&self,
Expand Down
1 change: 1 addition & 0 deletions coffee_plugin/src/plugin/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ impl State {
self.args.clone().unwrap()
}

#[allow(clippy::await_holding_lock)]
pub async fn setup(&self) -> Result<(), CoffeeError> {
self.coffee()
.lock()
Expand Down
1 change: 0 additions & 1 deletion tests/src/coffee_integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,6 @@ pub async fn install_plugin_in_two_networks() -> anyhow::Result<()> {
network: "regtest".to_string(),
};
let mut manager = CoffeeTesting::tmp_with_args(&args, dir.clone()).await?;
let root_path = manager.root_path().to_owned();
let result = manager.coffee().setup(&lightning_regtest_dir).await;
assert!(result.is_ok(), "{:?}", result);
// Add lightningd remote repository
Expand Down

0 comments on commit 289f7c0

Please sign in to comment.