Add #[must_use]

This commit is contained in:
Stephen Chung
2021-06-12 22:47:43 +08:00
parent 68ea8c27fd
commit 8ca24059b1
28 changed files with 489 additions and 55 deletions

View File

@@ -38,11 +38,13 @@ pub trait Package {
fn init(lib: &mut Module);
/// Retrieve the generic package library from this package.
#[must_use]
fn as_shared_module(&self) -> Shared<Module>;
/// Retrieve the generic package library from this package.
/// This method is deprecated and will be removed in the future.
/// Use [`as_shared_module`][Package::as_shared_module] instead.
#[must_use]
#[deprecated(since = "0.19.9", note = "use `as_shared_module` instead")]
fn get(&self) -> Shared<Module> {
self.as_shared_module()