Skip to content

Commit ff9d530

Browse files
committed
Tanker: deprecate device_id and device_list
1 parent 7de571d commit ff9d530

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/core.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,15 @@ impl Core {
5858
/// The current device's ID.
5959
///
6060
/// The Tanker status must be `Ready`.
61+
#[deprecated(since = "2.27.0")]
6162
pub fn device_id(&self) -> Result<String, Error> {
6263
unsafe { block_on(CTankerLib::get().device_id(self.ctanker)) }
6364
}
6465

6566
/// The user's devices list.
6667
///
6768
/// The Tanker status must be `Ready`.
69+
#[deprecated(since = "2.27.0")]
6870
pub async fn device_list(&self) -> Result<Vec<Device>, Error> {
6971
unsafe { CTankerLib::get().device_list(self.ctanker).await }
7072
}

tests/tanker_tests.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ async fn has_correct_device_list() -> Result<(), Error> {
6464
let app = TestApp::get().await;
6565
let tanker = app.start_anonymous(&app.create_identity(None)).await?;
6666

67+
#[allow(deprecated)]
6768
let list = tanker.device_list().await?;
6869
assert_eq!(list.len(), 1);
6970
assert!(!list[0].revoked);
70-
assert_eq!(list[0].id, tanker.device_id().unwrap());
71+
#[allow(deprecated)]
72+
let device_id = tanker.device_id().unwrap();
73+
assert_eq!(list[0].id, device_id);
7174

7275
tanker.stop().await
7376
}

0 commit comments

Comments
 (0)