diff options
author | Teddy Wing | 2018-11-09 20:46:08 +0100 |
---|---|---|
committer | Teddy Wing | 2018-11-09 20:46:08 +0100 |
commit | d7baf68d21a34e51b3ff193fc2d7513c7c270e6c (patch) | |
tree | 5d53fc552571f6a0e5fe9827ee4c23f8723b188f /license-generator/src/purchaser.rs | |
parent | 1c3e4bc7817b6b802e02cbf6c97e95752b2d9f45 (diff) | |
download | dome-key-web-d7baf68d21a34e51b3ff193fc2d7513c7c270e6c.tar.bz2 |
main(): Create a test purchaser
Manually check that our purchaser creation and database persistence
works.
Make `purchaser` entities public in order to call them.
Diffstat (limited to 'license-generator/src/purchaser.rs')
-rw-r--r-- | license-generator/src/purchaser.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/license-generator/src/purchaser.rs b/license-generator/src/purchaser.rs index 445a1dc..cf777d3 100644 --- a/license-generator/src/purchaser.rs +++ b/license-generator/src/purchaser.rs @@ -4,14 +4,14 @@ use sha1; use errors::*; -struct Purchaser<'a> { +pub struct Purchaser<'a> { name: &'a str, email: &'a str, secret: Option<String>, } impl<'a> Purchaser<'a> { - fn new(name: &'a str, email: &'a str) -> Self { + pub fn new(name: &'a str, email: &'a str) -> Self { let mut purchaser = Purchaser { name: name, email: email, @@ -33,7 +33,7 @@ impl<'a> Purchaser<'a> { self.secret = Some(digest); } - fn insert(&self, cx: &mut mysql::PooledConn) -> Result<()> { + pub fn insert(&self, cx: &mut mysql::PooledConn) -> Result<()> { let mut tx = cx.start_transaction( false, // consistent_snapshot None, // isolation_level |