Skip to content

Commit d6a7538

Browse files
committed
chore: cargo fmt
Signed-off-by: Sam Gammon <[email protected]>
1 parent f84f061 commit d6a7538

File tree

30 files changed

+92
-62
lines changed

30 files changed

+92
-62
lines changed

crates/nassun/src/fetch/dir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ mod test {
240240
use super::*;
241241
use std::{fs::File, io::Write, path::PathBuf};
242242

243-
use tempfile::{tempdir, TempDir};
243+
use tempfile::{TempDir, tempdir};
244244

245245
use crate::error::IoContext;
246246

crates/nassun/src/fetch/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use oro_package_spec::{GitInfo, PackageSpec};
1111
use url::Url;
1212

1313
use crate::error::{NassunError, Result};
14-
use crate::fetch::dir::DirFetcher;
1514
use crate::fetch::PackageFetcher;
15+
use crate::fetch::dir::DirFetcher;
1616
use crate::package::Package;
1717
use crate::resolver::PackageResolution;
1818
use crate::tarball::Tarball;

crates/nassun/src/package.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,10 @@ impl Package {
224224
// (bad data, etc), then go ahead and do a network
225225
// extract.
226226
Err(e) => {
227-
tracing::warn!("extracting package {:?} from cache failed, possily due to cache corruption: {e}", self.resolved());
227+
tracing::warn!(
228+
"extracting package {:?} from cache failed, possily due to cache corruption: {e}",
229+
self.resolved()
230+
);
228231
if let Some(entry) =
229232
cacache::index::find(cache, &crate::tarball::tarball_key(&sri))
230233
.map_err(|e| NassunError::ExtractCacheError(e, None))?

crates/nassun/src/tarball.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ use ssri::{Integrity, IntegrityChecker};
2929
#[cfg(not(target_arch = "wasm32"))]
3030
use tempfile::NamedTempFile;
3131

32+
use crate::TarballStream;
3233
use crate::entries::{Entries, Entry};
3334
#[cfg(not(target_arch = "wasm32"))]
3435
use crate::error::IoContext;
3536
use crate::error::{NassunError, Result};
3637
#[cfg(not(target_arch = "wasm32"))]
3738
use crate::package::ExtractMode;
38-
use crate::TarballStream;
3939

4040
#[cfg(not(target_arch = "wasm32"))]
4141
const MAX_IN_MEMORY_TARBALL_SIZE: usize = 1024 * 1024 * 5;

crates/node-maintainer/src/error.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ pub enum NodeMaintainerError {
125125
#[diagnostic(
126126
code(node_maintainer::junctions_not_supported),
127127
url(docsrs),
128-
help("The isolated linker requires your Windows user to either be able to create symlinks, which requires Administrator privileges, or create junctions, which require an NTFS filesystem, among other things. If you see this message, you might consider switching to the 'hoisted' linker instead.")
128+
help(
129+
"The isolated linker requires your Windows user to either be able to create symlinks, which requires Administrator privileges, or create junctions, which require an NTFS filesystem, among other things. If you see this message, you might consider switching to the 'hoisted' linker instead."
130+
)
129131
)]
130132
JunctionsNotSupported(
131133
std::path::PathBuf,
@@ -190,7 +192,9 @@ pub enum NodeMaintainerError {
190192
/// lockfile and get this error without any modifications to package.json,
191193
/// please [report this as a
192194
/// bug](https://github.com/orogene/orogene/issues/new).
193-
#[error("Locked file was requested, but a new dependency tree was resolved that would cause changes to the lockfile. The contents of `package.json` may have changed since the last time the lockfile was updated.")]
195+
#[error(
196+
"Locked file was requested, but a new dependency tree was resolved that would cause changes to the lockfile. The contents of `package.json` may have changed since the last time the lockfile was updated."
197+
)]
194198
#[diagnostic(
195199
code(node_maintainer::lockfile_mismatch),
196200
url(docsrs),

crates/node-maintainer/src/graph.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ use std::{
77

88
use indexmap::IndexMap;
99
use kdl::KdlDocument;
10-
use nassun::{package::Package, PackageResolution, PackageSpec};
10+
use nassun::{PackageResolution, PackageSpec, package::Package};
1111
use oro_common::CorgiManifest;
12-
use petgraph::stable_graph::{EdgeIndex, NodeIndex, StableGraph};
1312
#[cfg(not(target_arch = "wasm32"))]
1413
use petgraph::Direction;
14+
use petgraph::stable_graph::{EdgeIndex, NodeIndex, StableGraph};
1515
use unicase::UniCase;
1616

17-
use crate::{error::NodeMaintainerError, Lockfile, LockfileNode};
17+
use crate::{Lockfile, LockfileNode, error::NodeMaintainerError};
1818

1919
#[cfg(debug_assertions)]
2020
use NodeMaintainerError::GraphValidationError;

crates/node-maintainer/src/into_kdl.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ pub trait IntoKdl: IntoKdlSealed {}
66

77
impl IntoKdl for KdlDocument {}
88
impl IntoKdl for String {}
9-
impl IntoKdl for & str {}
10-
impl IntoKdl for & String {}
9+
impl IntoKdl for &str {}
10+
impl IntoKdl for &String {}
1111

1212
impl IntoKdlSealed for KdlDocument {
1313
fn into_kdl(self) -> Result<KdlDocument, NodeMaintainerError> {
@@ -21,13 +21,13 @@ impl IntoKdlSealed for String {
2121
}
2222
}
2323

24-
impl IntoKdlSealed for & str {
24+
impl IntoKdlSealed for &str {
2525
fn into_kdl(self) -> Result<KdlDocument, NodeMaintainerError> {
2626
Ok(self.parse()?)
2727
}
2828
}
2929

30-
impl IntoKdlSealed for & String {
30+
impl IntoKdlSealed for &String {
3131
fn into_kdl(self) -> Result<KdlDocument, NodeMaintainerError> {
3232
Ok(self.parse()?)
3333
}

crates/node-maintainer/src/linkers/hoisted.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::collections::HashSet;
22
use std::ffi::OsStr;
33
use std::path::PathBuf;
44
use std::sync::atomic::AtomicUsize;
5-
use std::sync::{atomic, Arc};
5+
use std::sync::{Arc, atomic};
66

77
use dashmap::DashSet;
88
use futures::lock::Mutex;
@@ -98,7 +98,10 @@ impl HoistedLinker {
9898
}
9999
}
100100

101-
tracing::debug!("No metadata file found in node_modules/. Pruned entire node_modules/ directory in {}ms.", start.elapsed().as_micros() / 1000);
101+
tracing::debug!(
102+
"No metadata file found in node_modules/. Pruned entire node_modules/ directory in {}ms.",
103+
start.elapsed().as_micros() / 1000
104+
);
102105

103106
// TODO: get an accurate count here?
104107
return Ok(0);

crates/node-maintainer/src/linkers/isolated.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@ use std::{
22
collections::{BinaryHeap, HashMap, HashSet},
33
path::{Path, PathBuf},
44
sync::{
5-
atomic::{self, AtomicUsize},
65
Arc,
6+
atomic::{self, AtomicUsize},
77
},
88
};
99

1010
use dashmap::DashSet;
11-
use futures::{lock::Mutex, StreamExt, TryStreamExt};
11+
use futures::{StreamExt, TryStreamExt, lock::Mutex};
1212
use nassun::ExtractMode;
1313
use oro_common::BuildManifest;
14-
use petgraph::{stable_graph::NodeIndex, visit::EdgeRef, Direction};
14+
use petgraph::{Direction, stable_graph::NodeIndex, visit::EdgeRef};
1515
use ssri::Integrity;
1616

17-
use crate::{error::IoContext, graph::Graph, NodeMaintainerError, META_FILE_NAME, STORE_DIR_NAME};
17+
use crate::{META_FILE_NAME, NodeMaintainerError, STORE_DIR_NAME, error::IoContext, graph::Graph};
1818

1919
use super::LinkerOptions;
2020

@@ -94,7 +94,10 @@ impl IsolatedLinker {
9494
}
9595
}
9696

97-
tracing::debug!("No metadata file found in node_modules/. Pruned entire node_modules/ directory in {}ms.", start.elapsed().as_micros() / 1000);
97+
tracing::debug!(
98+
"No metadata file found in node_modules/. Pruned entire node_modules/ directory in {}ms.",
99+
start.elapsed().as_micros() / 1000
100+
);
98101

99102
// TODO: get an accurate count here?
100103
return Ok(0);

crates/node-maintainer/src/linkers/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::{
99
};
1010

1111
#[cfg(not(target_arch = "wasm32"))]
12-
use futures::{lock::Mutex, StreamExt, TryStreamExt};
12+
use futures::{StreamExt, TryStreamExt, lock::Mutex};
1313
#[cfg(not(target_arch = "wasm32"))]
1414
use hoisted::HoistedLinker;
1515
#[cfg(not(target_arch = "wasm32"))]
@@ -23,8 +23,8 @@ use petgraph::stable_graph::NodeIndex;
2323

2424
#[cfg(not(target_arch = "wasm32"))]
2525
use crate::{
26-
error::IoContext, graph::Graph, Lockfile, NodeMaintainerError, ProgressHandler, PruneProgress,
27-
ScriptLineHandler, ScriptStartHandler,
26+
Lockfile, NodeMaintainerError, ProgressHandler, PruneProgress, ScriptLineHandler,
27+
ScriptStartHandler, error::IoContext, graph::Graph,
2828
};
2929

3030
#[cfg(not(target_arch = "wasm32"))]

0 commit comments

Comments
 (0)