Skip to content

Commit

Permalink
refactor(identity): fix import warnings in keypair.rs
Browse files Browse the repository at this point in the history
- Adding conditional `cfg` in `keypair.rs` imports.
- Adding `#[allow(unused_variables)]` on the top of the `sign` function.

Pull-Request: #4047.
  • Loading branch information
tcoratger authored Jun 8, 2023
1 parent f66420c commit 4532302
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions identity/src/keypair.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

#[cfg(any(
feature = "ecdsa",
feature = "secp256k1",
feature = "ed25519",
feature = "rsa"
))]
use crate::error::OtherVariantError;
use crate::error::{DecodingError, SigningError};
#[cfg(any(
Expand All @@ -27,7 +33,19 @@ use crate::error::{DecodingError, SigningError};
feature = "rsa"
))]
use crate::proto;
#[cfg(any(
feature = "ecdsa",
feature = "secp256k1",
feature = "ed25519",
feature = "rsa"
))]
use quick_protobuf::{BytesReader, Writer};
#[cfg(any(
feature = "ecdsa",
feature = "secp256k1",
feature = "ed25519",
feature = "rsa"
))]
use std::convert::TryFrom;

#[cfg(feature = "ed25519")]
Expand Down Expand Up @@ -159,6 +177,7 @@ impl Keypair {

/// Sign a message using the private key of this keypair, producing
/// a signature that can be verified using the corresponding public key.
#[allow(unused_variables)]
pub fn sign(&self, msg: &[u8]) -> Result<Vec<u8>, SigningError> {
match self.keypair {
#[cfg(feature = "ed25519")]
Expand Down

0 comments on commit 4532302

Please sign in to comment.