summary refs log tree commit diff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2019-08-04 14:01:56 +0300
committerEfraim Flashner <efraim@flashner.co.il>2019-08-12 11:57:29 +0300
commitac3e813b846a9d1568847897d6b76390a024a760 (patch)
tree87314be32c7401f881185f93ebbead0389fb6321
parentcbfef1f903c9b3e813abd0d1c860a5d52502f897 (diff)
downloadguix-ac3e813b846a9d1568847897d6b76390a024a760.tar.gz
gnu: Add rust-scopeguard.
* gnu/packages/crates-io.scm (rust-scopeguard): New variable.
-rw-r--r--gnu/packages/crates-io.scm23
1 files changed, 23 insertions, 0 deletions
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 73bff909a8..478b06b698 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -599,6 +599,29 @@ library's old @code{scoped_thread_local!} macro for providing scoped access to
     (license (list license:asl2.0
                    license:expat))))
 
+(define-public rust-scopeguard
+  (package
+    (name "rust-scopeguard")
+    (version "1.0.0")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (crate-uri "scopeguard" version))
+        (file-name (string-append name "-" version ".tar.gz"))
+        (sha256
+         (base32
+          "03aay84r1f6w87ckbpj6cc4rnsxkxcfs13n5ynxjia0qkgjiabml"))))
+    (build-system cargo-build-system)
+    (home-page "https://github.com/bluss/scopeguard")
+    (synopsis "Scope guard which will run a closure even out of scope")
+    (description "This package provides a RAII scope guard that will run a
+given closure when it goes out of scope, even if the code between panics
+(assuming unwinding panic).  Defines the macros @code{defer!},
+@code{defer_on_unwind!}, @code{defer_on_success!} as shorthands for guards
+with one of the implemented strategies.")
+    (license (list license:asl2.0
+                   license:expat))))
+
 (define-public rust-unicode-xid
   (package
     (name "rust-unicode-xid")