Skip to content

Commit 463e795

Browse files
committed
refactor(source): Make it easier to fork PathSource
1 parent b2daa91 commit 463e795

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/cargo/sources/path.rs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ impl<'gctx> PathSource<'gctx> {
4949
///
5050
/// This source will only return the package at precisely the `path`
5151
/// specified, and it will be an error if there's not a package at `path`.
52-
pub fn new(path: &Path, source_id: SourceId, gctx: &'gctx GlobalContext) -> PathSource<'gctx> {
53-
PathSource {
52+
pub fn new(path: &Path, source_id: SourceId, gctx: &'gctx GlobalContext) -> Self {
53+
Self {
5454
source_id,
5555
path: path.to_path_buf(),
5656
updated: false,
@@ -68,14 +68,10 @@ impl<'gctx> PathSource<'gctx> {
6868
///
6969
/// Note that this should be used with care and likely shouldn't be chosen
7070
/// by default!
71-
pub fn new_recursive(
72-
root: &Path,
73-
id: SourceId,
74-
gctx: &'gctx GlobalContext,
75-
) -> PathSource<'gctx> {
76-
PathSource {
71+
pub fn new_recursive(root: &Path, id: SourceId, gctx: &'gctx GlobalContext) -> Self {
72+
Self {
7773
recursive: true,
78-
..PathSource::new(root, id, gctx)
74+
..Self::new(root, id, gctx)
7975
}
8076
}
8177

0 commit comments

Comments
 (0)