commit | 01405f07b072171d36cb82337620883f9ef4d2f7 | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Sun Oct 02 09:05:02 2016 -0700 |
committer | David Tolnay <dtolnay@gmail.com> | Sun Oct 02 09:05:02 2016 -0700 |
tree | ccfbee97add7282fad2eaabbaac45c552f6e7510 | |
parent | 42602293ebf3d4458df32366237b7f610e41683f [diff] |
Add Lifetime::new
diff --git a/src/generics.rs b/src/generics.rs index 40025c4..b3ee1c2 100644 --- a/src/generics.rs +++ b/src/generics.rs
@@ -14,6 +14,14 @@ pub ident: Ident, } +impl Lifetime { + pub fn new<T: Into<Ident>>(t: T) -> Self { + Lifetime { + ident: Ident::new(t), + } + } +} + /// A lifetime definition, e.g. `'a: 'b+'c+'d` #[derive(Debug, Clone, Eq, PartialEq)] pub struct LifetimeDef {