Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mischnic committed Jul 30, 2024
1 parent fdf029f commit c4e171e
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 40 deletions.
6 changes: 2 additions & 4 deletions crates/turbopack-core/src/resolve/alias_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -599,8 +599,6 @@ where
}

/// Returns the wrapped value.
///
/// Only implemented when `T::Output` is `T`.
pub fn as_self(&'a self) -> &T::Output<'a> {
match self {
Self::Exact(v) => v,
Expand All @@ -617,7 +615,7 @@ where
///
/// Consumes the match.
///
/// Only implemented when `T::Output` is `Result<T, _>`.
/// Only implemented when `T::Output` is some `Result<_, _>`.
pub fn try_into_self(self) -> Result<R, E> {
Ok(match self {
Self::Exact(v) => v?,
Expand All @@ -635,7 +633,7 @@ where
///
/// Consumes the match.
///
/// Only implemented when `T::Output` is `impl Future<Result<T, _>>`
/// Only implemented when `T::Output` is some `impl Future<Result<_, _>>`
pub async fn try_join_into_self(self) -> Result<R, E> {
Ok(match self {
Self::Exact(v) => v.await?,
Expand Down
3 changes: 0 additions & 3 deletions crates/turbopack-core/src/resolve/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2579,15 +2579,12 @@ async fn handle_exports_imports_field(
.collect::<Result<Vec<_>>>()?;

for value in values.iter() {
// println!("handle_exports_imports_field {:?}", value);

if value.add_results(
conditions,
unspecified_conditions,
&mut conditions_state,
&mut results,
) {
// println!("handle_exports_imports_field break");
break;
}
}
Expand Down
2 changes: 0 additions & 2 deletions crates/turbopack-core/src/resolve/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ impl AliasTemplate for Vc<ImportMapping> {
Box::pin(async move {
let this = &*self.await?;
Ok(match this {
// _ => ImportMapping::Ignore
ImportMapping::External(name, ty) => {
ReplacedImportMapping::External(name.clone(), *ty)
}
Expand Down Expand Up @@ -172,7 +171,6 @@ impl AliasTemplate for Vc<ImportMapping> {
Box::pin(async move {
let this = &*self.await?;
Ok(match this {
// _ => ImportMapping::Ignore
ImportMapping::External(name, ty) => {
if let Some(name) = name {
ReplacedImportMapping::External(
Expand Down
31 changes: 0 additions & 31 deletions crates/turbopack-core/src/resolve/remap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,37 +330,6 @@ impl SubpathValueResult {
SubpathValueResult::Excluded => true,
}
}

// fn try_new(value: &Value, ty: ExportImport) -> Result<Self> {
// match value {
// Value::Null => Ok(SubpathValue::Excluded),
// Value::String(s) => Ok(SubpathValue::Result(s.as_str().into())),
// Value::Number(_) => bail!("numeric values are invalid in {ty}s field
// entries"), Value::Bool(_) => bail!("boolean values are invalid in
// {ty}s field entries"), Value::Object(object) =>
// Ok(SubpathValue::Conditional( object
// .iter()
// .map(|(key, value)| {
// if key.starts_with('.') {
// bail!(
// "invalid key \"{}\" in an {ty} field conditions
// object. Did you \ mean to place this request
// at a higher level?", key
// );
// }

// Ok((key.as_str().into(), SubpathValue::try_new(value,
// ty)?)) })
// .collect::<Result<Vec<_>>>()?,
// )),
// Value::Array(array) => Ok(SubpathValue::Alternatives(
// array
// .iter()
// .map(|value| SubpathValue::try_new(value, ty))
// .collect::<Result<Vec<_>>>()?,
// )),
// }
// }
}

struct ResultsIterMut<'a> {
Expand Down

0 comments on commit c4e171e

Please sign in to comment.