Skip to content

Commit 5469a78

Browse files
committed
notifications: log directly when linking directories
1 parent 42c18db commit 5469a78

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

src/install.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl InstallMethod<'_> {
101101
Ok(true)
102102
}
103103
InstallMethod::Link { src, .. } => {
104-
utils::symlink_dir(src, path, notify_handler)?;
104+
utils::symlink_dir(src, path)?;
105105
Ok(true)
106106
}
107107
InstallMethod::Dist(opts) => {

src/notifications.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ pub enum Notification<'a> {
3737
StrayHash(&'a Path),
3838
SignatureInvalid(&'a str),
3939
RetryingDownload(&'a str),
40-
LinkingDirectory(&'a Path, &'a Path),
4140
CopyingDirectory(&'a Path, &'a Path),
4241
RemovingDirectory(&'a str, &'a Path),
4342
DownloadingFile(&'a Url, &'a Path),
@@ -123,7 +122,6 @@ impl Notification<'_> {
123122
SignatureInvalid(_) => NotificationLevel::Warn,
124123
SetDefaultBufferSize(_) => NotificationLevel::Trace,
125124
RemovingDirectory(_, _)
126-
| LinkingDirectory(_, _)
127125
| CopyingDirectory(_, _)
128126
| DownloadingFile(_, _)
129127
| DownloadContentLengthReceived(_, _)
@@ -258,7 +256,6 @@ impl Display for Notification<'_> {
258256
SignatureInvalid(url) => write!(f, "Signature verification failed for '{url}'"),
259257
RetryingDownload(url) => write!(f, "retrying download for '{url}'"),
260258
Error(e) => write!(f, "error: '{e}'"),
261-
LinkingDirectory(_, dest) => write!(f, "linking directory from: '{}'", dest.display()),
262259
CopyingDirectory(src, _) => write!(f, "copying directory from: '{}'", src.display()),
263260
RemovingDirectory(name, path) => {
264261
write!(f, "removing {} directory: '{}'", name, path.display())

src/utils/mod.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,8 @@ pub(crate) fn assert_is_directory(path: &Path) -> Result<()> {
154154
}
155155
}
156156

157-
pub(crate) fn symlink_dir<'a, N>(
158-
src: &'a Path,
159-
dest: &'a Path,
160-
notify_handler: &dyn Fn(N),
161-
) -> Result<()>
162-
where
163-
N: From<Notification<'a>>,
164-
{
165-
notify_handler(Notification::LinkingDirectory(src, dest).into());
157+
pub(crate) fn symlink_dir(src: &Path, dest: &Path) -> Result<()> {
158+
debug!(source = %src.display(), destination = %dest.display(), "linking directory");
166159
raw::symlink_dir(src, dest).with_context(|| {
167160
format!(
168161
"could not create link from '{}' to '{}'",

0 commit comments

Comments
 (0)