Skip to content

Commit 83131fc

Browse files
committed
docs(source): consolidate "forwards methods" comment in one place
1 parent 5ce31c6 commit 83131fc

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/cargo/core/source/mod.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,28 +184,24 @@ pub enum MaybePackage {
184184
},
185185
}
186186

187+
/// A blanket implementation forwards all methods to [`Source`].
187188
impl<'a, T: Source + ?Sized + 'a> Source for Box<T> {
188-
/// Forwards to `Source::source_id`.
189189
fn source_id(&self) -> SourceId {
190190
(**self).source_id()
191191
}
192192

193-
/// Forwards to `Source::replaced_source_id`.
194193
fn replaced_source_id(&self) -> SourceId {
195194
(**self).replaced_source_id()
196195
}
197196

198-
/// Forwards to `Source::supports_checksums`.
199197
fn supports_checksums(&self) -> bool {
200198
(**self).supports_checksums()
201199
}
202200

203-
/// Forwards to `Source::requires_precise`.
204201
fn requires_precise(&self) -> bool {
205202
(**self).requires_precise()
206203
}
207204

208-
/// Forwards to `Source::query`.
209205
fn query(
210206
&mut self,
211207
dep: &Dependency,
@@ -223,7 +219,6 @@ impl<'a, T: Source + ?Sized + 'a> Source for Box<T> {
223219
(**self).set_quiet(quiet)
224220
}
225221

226-
/// Forwards to `Source::download`.
227222
fn download(&mut self, id: PackageId) -> CargoResult<MaybePackage> {
228223
(**self).download(id)
229224
}
@@ -232,12 +227,10 @@ impl<'a, T: Source + ?Sized + 'a> Source for Box<T> {
232227
(**self).finish_download(id, data)
233228
}
234229

235-
/// Forwards to `Source::fingerprint`.
236230
fn fingerprint(&self, pkg: &Package) -> CargoResult<String> {
237231
(**self).fingerprint(pkg)
238232
}
239233

240-
/// Forwards to `Source::verify`.
241234
fn verify(&self, pkg: PackageId) -> CargoResult<()> {
242235
(**self).verify(pkg)
243236
}
@@ -263,6 +256,7 @@ impl<'a, T: Source + ?Sized + 'a> Source for Box<T> {
263256
}
264257
}
265258

259+
/// A blanket implementation forwards all methods to [`Source`].
266260
impl<'a, T: Source + ?Sized + 'a> Source for &'a mut T {
267261
fn source_id(&self) -> SourceId {
268262
(**self).source_id()

0 commit comments

Comments
 (0)