Remove unnecessary clone()

Co-authored-by: Jack Grigg <jack@electriccoin.co>
This commit is contained in:
therealyingtong 2021-03-24 12:30:03 +08:00
parent 9c75839e62
commit a2c1bfb52a
1 changed files with 4 additions and 3 deletions

View File

@ -134,11 +134,12 @@ pub struct CommitDomain {
impl CommitDomain {
/// Constructs a new `CommitDomain` with a specific prefix string.
pub(crate) fn new(domain: &str) -> Self {
let m_prefix = domain.to_owned() + "-M";
let r_prefix = domain.to_owned() + "-r";
let m_prefix = format!("{}-M", domain);
let r_prefix = format!("{}-r", domain);
let hasher_r = pallas::Point::hash_to_curve(&r_prefix);
CommitDomain {
M: HashDomain::new(&m_prefix),
R: pallas::Point::hash_to_curve(&r_prefix.clone())(&[]),
R: hasher_r(&[]),
}
}