@@ -66,66 +66,66 @@ mod write {
66
66
67
67
/// Convenient extraction of typed object.
68
68
impl Object {
69
- /// Turns this instance into a [`Blob`][Blob] , panic otherwise.
69
+ /// Turns this instance into a [`Blob`], panic otherwise.
70
70
pub fn into_blob ( self ) -> Blob {
71
71
match self {
72
72
Object :: Blob ( v) => v,
73
73
_ => panic ! ( "BUG: not a blob" ) ,
74
74
}
75
75
}
76
- /// Turns this instance into a [`Commit`][Commit] panic otherwise.
76
+ /// Turns this instance into a [`Commit`] panic otherwise.
77
77
pub fn into_commit ( self ) -> Commit {
78
78
match self {
79
79
Object :: Commit ( v) => v,
80
80
_ => panic ! ( "BUG: not a commit" ) ,
81
81
}
82
82
}
83
- /// Turns this instance into a [`Tree`][Tree] panic otherwise.
83
+ /// Turns this instance into a [`Tree`] panic otherwise.
84
84
pub fn into_tree ( self ) -> Tree {
85
85
match self {
86
86
Object :: Tree ( v) => v,
87
87
_ => panic ! ( "BUG: not a tree" ) ,
88
88
}
89
89
}
90
- /// Turns this instance into a [`Tag`][Tag] panic otherwise.
90
+ /// Turns this instance into a [`Tag`] panic otherwise.
91
91
pub fn into_tag ( self ) -> Tag {
92
92
match self {
93
93
Object :: Tag ( v) => v,
94
94
_ => panic ! ( "BUG: not a tag" ) ,
95
95
}
96
96
}
97
- /// Turns this instance into a [`Blob`][Blob] if it is one.
97
+ /// Turns this instance into a [`Blob`] if it is one.
98
98
#[ allow( clippy:: result_large_err) ]
99
99
pub fn try_into_blob ( self ) -> Result < Blob , Self > {
100
100
match self {
101
101
Object :: Blob ( v) => Ok ( v) ,
102
102
_ => Err ( self ) ,
103
103
}
104
104
}
105
- /// Turns this instance into a [`BlobRef`][BlobRef] if it is a blob.
105
+ /// Turns this instance into a [`BlobRef`] if it is a blob.
106
106
pub fn try_into_blob_ref ( & self ) -> Option < BlobRef < ' _ > > {
107
107
match self {
108
108
Object :: Blob ( v) => Some ( v. to_ref ( ) ) ,
109
109
_ => None ,
110
110
}
111
111
}
112
- /// Turns this instance into a [`Commit`][Commit] if it is one.
112
+ /// Turns this instance into a [`Commit`] if it is one.
113
113
#[ allow( clippy:: result_large_err) ]
114
114
pub fn try_into_commit ( self ) -> Result < Commit , Self > {
115
115
match self {
116
116
Object :: Commit ( v) => Ok ( v) ,
117
117
_ => Err ( self ) ,
118
118
}
119
119
}
120
- /// Turns this instance into a [`Tree`][Tree] if it is one.
120
+ /// Turns this instance into a [`Tree`] if it is one.
121
121
#[ allow( clippy:: result_large_err) ]
122
122
pub fn try_into_tree ( self ) -> Result < Tree , Self > {
123
123
match self {
124
124
Object :: Tree ( v) => Ok ( v) ,
125
125
_ => Err ( self ) ,
126
126
}
127
127
}
128
- /// Turns this instance into a [`Tag`][Tag] if it is one.
128
+ /// Turns this instance into a [`Tag`] if it is one.
129
129
#[ allow( clippy:: result_large_err) ]
130
130
pub fn try_into_tag ( self ) -> Result < Tag , Self > {
131
131
match self {
@@ -134,28 +134,28 @@ impl Object {
134
134
}
135
135
}
136
136
137
- /// Returns a [`Blob`][Blob] if it is one.
137
+ /// Returns a [`Blob`] if it is one.
138
138
pub fn as_blob ( & self ) -> Option < & Blob > {
139
139
match self {
140
140
Object :: Blob ( v) => Some ( v) ,
141
141
_ => None ,
142
142
}
143
143
}
144
- /// Returns a [`Commit`][Commit] if it is one.
144
+ /// Returns a [`Commit`] if it is one.
145
145
pub fn as_commit ( & self ) -> Option < & Commit > {
146
146
match self {
147
147
Object :: Commit ( v) => Some ( v) ,
148
148
_ => None ,
149
149
}
150
150
}
151
- /// Returns a [`Tree`][Tree] if it is one.
151
+ /// Returns a [`Tree`] if it is one.
152
152
pub fn as_tree ( & self ) -> Option < & Tree > {
153
153
match self {
154
154
Object :: Tree ( v) => Some ( v) ,
155
155
_ => None ,
156
156
}
157
157
}
158
- /// Returns a [`Tag`][Tag] if it is one.
158
+ /// Returns a [`Tag`] if it is one.
159
159
pub fn as_tag ( & self ) -> Option < & Tag > {
160
160
match self {
161
161
Object :: Tag ( v) => Some ( v) ,
0 commit comments