Skip to content

Commit 9c26fbb

Browse files
authored
Fix warning about filename collision when building pocket mock (#1211)
warning: output filename collision. The lib target `pocketclient` in package `pocketclient-mock v0.1.0 (~/3l/mock/pocketclient)` has the same output filename as the lib target `pocketclient` in package `pocketclient v0.1.0 (~/3l/pocketclient)`. Colliding filename is: ~/3l/target/debug/libpocketclient.rlib The targets should have unique names. Consider changing their names to be unique or compiling them separately. This may become a hard error in the future; see <rust-lang/cargo#6313>.
1 parent 0437b8d commit 9c26fbb

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

mock/pocketclient/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ name = "pocketclient-mock"
33
version = "0.1.0"
44
edition = "2021"
55

6-
[lib]
7-
name = "pocketclient"
8-
96
[dependencies]
107
perro = { git = "https://github.com/getlipa/perro", tag = "v1.2.0" }
118
pocketclient = { path = "../../pocketclient" }

src/data_store.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ use crate::errors::Result;
33
use crate::migrations::migrate;
44
use crate::{EnableStatus, ExchangeRate, OfferKind, PocketOfferError, TzConfig, UserPreferences};
55

6+
use crate::pocketclient::FiatTopupInfo;
67
use chrono::{DateTime, Utc};
78
use crow::{PermanentFailureCode, TemporaryFailureCode};
89
use perro::MapToError;
9-
use pocketclient::FiatTopupInfo;
1010
use rusqlite::{backup, params, Connection, OptionalExtension, Params, Row};
1111
use std::time::{Duration, SystemTime, UNIX_EPOCH};
1212

@@ -661,9 +661,9 @@ mod tests {
661661
use crate::{EnableStatus, ExchangeRate, OfferKind, PocketOfferError, UserPreferences};
662662

663663
use crate::analytics::AnalyticsConfig;
664+
use crate::pocketclient::FiatTopupInfo;
664665
use crow::TopupError::TemporaryFailure;
665666
use crow::{PermanentFailureCode, TemporaryFailureCode};
666-
use pocketclient::FiatTopupInfo;
667667
use std::fs;
668668
use std::thread::sleep;
669669
use std::time::{Duration, SystemTime, UNIX_EPOCH};

src/lib.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,15 @@ use crate::task_manager::TaskManager;
9292
use crate::util::{
9393
replace_byte_arrays_by_hex_string, unix_timestamp_to_system_time, LogIgnoreError,
9494
};
95-
pub use pocketclient::FiatTopupInfo;
96-
use pocketclient::PocketClient;
95+
96+
#[cfg(not(feature = "mock-deps"))]
97+
#[allow(clippy::single_component_path_imports)]
98+
use pocketclient;
99+
#[cfg(feature = "mock-deps")]
100+
use pocketclient_mock as pocketclient;
101+
102+
pub use crate::pocketclient::FiatTopupInfo;
103+
use crate::pocketclient::PocketClient;
97104

98105
pub use breez_sdk_core::error::ReceiveOnchainError as SwapError;
99106
pub use breez_sdk_core::error::RedeemOnchainError as SweepError;

0 commit comments

Comments
 (0)