Skip to content

Commit 960963c

Browse files
committed
chore: cargo fmt
Signed-off-by: Sam Gammon <[email protected]>
1 parent 0fa68e3 commit 960963c

File tree

38 files changed

+123
-103
lines changed

38 files changed

+123
-103
lines changed

crates/nassun/src/fetch/dir.rs

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

267-
use tempfile::{tempdir, TempDir};
267+
use tempfile::{TempDir, tempdir};
268268

269269
use crate::error::IoContext;
270270

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/fetch/npm.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,7 @@ impl PackageFetcher for NpmFetcher {
9898
) -> Result<Arc<CorgiPackument>> {
9999
// When fetching the packument itself, we need the _package_ name, not
100100
// its alias! Hence these shenanigans.
101-
if let PackageSpec::Npm {
102-
name,
103-
scope,
104-
..
105-
} = spec.target()
106-
{
101+
if let PackageSpec::Npm { name, scope, .. } = spec.target() {
107102
if let Some(packument) = self.corgi_packuments.get(name) {
108103
if self.cache_packuments {
109104
return Ok(packument.value().clone());
@@ -129,12 +124,7 @@ impl PackageFetcher for NpmFetcher {
129124
pkg @ PackageSpec::Npm { .. } => pkg,
130125
_ => unreachable!(),
131126
};
132-
if let PackageSpec::Npm {
133-
name,
134-
scope,
135-
..
136-
} = pkg
137-
{
127+
if let PackageSpec::Npm { name, scope, .. } = pkg {
138128
if let Some(packument) = self.packuments.get(name) {
139129
if self.cache_packuments {
140130
return Ok(packument.value().clone());

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/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)