Skip to content

Commit 34c3043

Browse files
chore: Format and lints
1 parent 8ea7223 commit 34c3043

10 files changed

Lines changed: 21 additions & 19 deletions

File tree

compiler/pavexc/src/compiler/analyses/call_graph/application_state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ use crate::compiler::analyses::framework_items::FrameworkItemDb;
2323
use crate::compiler::app::GENERATED_APP_PACKAGE_ID;
2424
use crate::compiler::computation::{Computation, MatchResultVariant};
2525
use crate::language::{
26-
Callable, CallableInput, EnumVariantConstructorPath, EnumVariantInit, GenericArgument, PathType,
27-
RustIdentifier, Type,
26+
Callable, CallableInput, EnumVariantConstructorPath, EnumVariantInit, GenericArgument,
27+
PathType, RustIdentifier, Type,
2828
};
2929
use crate::rustdoc::{CORE_PACKAGE_ID_REPR, CrateCollection};
3030

compiler/pavexc/src/compiler/analyses/call_graph/borrow_checker/clone.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use crate::compiler::analyses::user_components::ScopeId;
1313
use crate::compiler::computation::Computation;
1414
use crate::compiler::utils::resolve_type_path;
1515
use crate::language::{
16-
Callable, CallableInput, FnHeader, Lifetime, RustIdentifier, PathType, TraitMethod,
16+
Callable, CallableInput, FnHeader, Lifetime, PathType, RustIdentifier, TraitMethod,
1717
TraitMethodPath, Type, TypeReference,
1818
};
1919
use crate::rustdoc::CrateCollection;

compiler/pavexc/src/compiler/analyses/processing_pipeline/pipeline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use crate::compiler::utils::LifetimeGenerator;
2525
use crate::diagnostic::{AnnotatedSource, CompilerDiagnostic, HelpWithSnippet};
2626
use crate::language::{
2727
Callable, CallableInput, CanonicalType, GenericArgument, GenericLifetimeParameter, Lifetime,
28-
RustIdentifier, PathType, PathTypeExt, StructLiteralInit, Type, TypeReference,
28+
PathType, PathTypeExt, RustIdentifier, StructLiteralInit, Type, TypeReference,
2929
};
3030
use crate::rustdoc::CrateCollection;
3131

compiler/pavexc/src/compiler/analyses/user_components/annotations/coordinates.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ use super::{
1111
AuxiliaryData, ConfigType, ImplInfo, annotated_item2type, cannot_resolve_callable_path,
1212
invalid_config_type, validate_route_path,
1313
};
14-
use rustdoc_resolver::{resolve_free_function, rustdoc_method2callable};
1514
use crate::compiler::analyses::user_components::{UserComponent, UserComponentId};
1615
use crate::compiler::component::{DefaultStrategy, PrebuiltType};
1716
use pavex_bp_schema::{CloningPolicy, Lint, LintSetting};
17+
use rustdoc_resolver::{resolve_free_function, rustdoc_method2callable};
1818

1919
/// Resolve coordinates to the annotation they point to.
2020
/// Then process the corresponding item.

compiler/pavexc/src/compiler/resolvers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use tracing_log_error::log_error;
1010
use crate::language::{
1111
Callable, CallableInput, CallableItem, FQGenericArgument, FQPath, FQPathSegment, FQPathType,
1212
FnHeader, FreeFunction, FreeFunctionPath, Generic, GenericArgument, GenericLifetimeParameter,
13-
InherentMethod, InherentMethodPath, RustIdentifier, PathType, TraitMethod, TraitMethodPath,
13+
InherentMethod, InherentMethodPath, PathType, RustIdentifier, TraitMethod, TraitMethodPath,
1414
Type, UnknownPath, find_rustdoc_callable_items, find_rustdoc_item_type, resolve_fq_path_type,
1515
};
1616
use crate::rustdoc::{CannotGetCrateData, CrateCollection, ResolvedItem};

compiler/pavexc/src/language/fq_path_resolution.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ use std::sync::Arc;
44

55
use rustdoc_types::ItemEnum;
66

7-
use rustdoc_resolver::{GenericBindings, resolve_type};
87
use crate::language::callable_path::{CallPathGenericArgument, CallPathLifetime, CallPathType};
98
use crate::language::krate_name::dependency_name2package_id;
109
use crate::language::resolved_type::{Array, GenericArgument, Slice};
@@ -13,6 +12,7 @@ use crate::rustdoc::{
1312
CannotGetCrateData, CrateCollection, CrateCollectionExt, GlobalItemId, ResolvedItem,
1413
};
1514
use rustdoc_ext::RustdocKindExt;
15+
use rustdoc_resolver::{GenericBindings, resolve_type};
1616

1717
use super::RawIdentifiers;
1818
use super::fq_path::*;

compiler/pavexc/src/language/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use pavex_bp_schema::CreatedAt;
1212
pub(crate) use resolved_type::{
1313
Callable, CallableInput, CanonicalType, EnumVariantConstructorPath, EnumVariantInit, FnHeader,
1414
FreeFunction, FreeFunctionPath, Generic, GenericArgument, GenericLifetimeParameter,
15-
InherentMethod, InherentMethodPath, Lifetime, RustIdentifier, PathType, PathTypeExt,
16-
RawPointer, StructLiteralInit, TraitMethod, TraitMethodPath, Tuple, Type, TypeReference,
15+
InherentMethod, InherentMethodPath, Lifetime, PathType, PathTypeExt, RawPointer,
16+
RustIdentifier, StructLiteralInit, TraitMethod, TraitMethodPath, Tuple, Type, TypeReference,
1717
};
1818

1919
mod callable_path;

compiler/pavexc/src/rustdoc/queries/collection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ use std::sync::Arc;
33

44
use rustdoc_types::{Item, ItemEnum};
55

6-
use rustdoc_resolver::{GenericBindings, resolve_type};
76
use crate::language::{
87
FQGenericArgument, FQPathType, UnknownCrate, krate2package_id, resolve_fq_path_type,
98
};
109
use crate::rustdoc::CannotGetCrateData;
1110
use rustdoc_ext::RustdocKindExt;
11+
use rustdoc_resolver::{GenericBindings, resolve_type};
1212

1313
use super::super::AnnotatedItem;
1414
use super::super::annotations::AnnotationCoordinates;

rustdoc/rustdoc_resolver/src/resolve_type.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ use rustdoc_ir::{
1010
Array, Generic, GenericArgument, GenericLifetimeParameter, PathType, RawPointer, Slice, Tuple,
1111
Type, TypeReference,
1212
};
13-
use rustdoc_processor::indexing::CrateIndexer;
1413
use rustdoc_processor::CrateCollection;
14+
use rustdoc_processor::indexing::CrateIndexer;
1515

16-
use crate::errors::*;
1716
use crate::GenericBindings;
17+
use crate::errors::*;
1818

1919
/// Convert a `rustdoc_types::Type` into a `rustdoc_ir::Type`, recursively resolving
2020
/// through type aliases and substituting generic bindings.
@@ -520,16 +520,15 @@ fn skip_default<I: CrateIndexer>(krate_collection: &CrateCollection<I>, default:
520520
// the canonical path. Fall back to the well-known path if resolution
521521
// fails (e.g. alloc docs not available).
522522
let alloc_pid = PackageId::new(rustdoc_processor::ALLOC_PACKAGE_ID_REPR);
523-
if let Some(krate) = krate_collection.get_crate_by_package_id(&alloc_pid) {
524-
if let Some(item_entry) = krate
523+
if let Some(krate) = krate_collection.get_crate_by_package_id(&alloc_pid)
524+
&& let Some(item_entry) = krate
525525
.import_index
526526
.items
527527
.iter()
528528
.find(|(_, entry)| entry.canonical_path() == ["alloc", "alloc", "Global"])
529529
{
530530
return item_entry.1.canonical_path().to_vec();
531531
}
532-
}
533532
vec!["alloc".into(), "alloc".into(), "Global".into()]
534533
});
535534

rustdoc/rustdoc_resolver/src/type_def.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@
22
33
use rustdoc_types::{Item, ItemEnum};
44

5-
use rustdoc_ir::{Generic, GenericArgument, GenericLifetimeParameter, PathType, Type};
65
use rustdoc_ext::RustdocKindExt;
6+
use rustdoc_ir::{Generic, GenericArgument, GenericLifetimeParameter, PathType, Type};
7+
use rustdoc_processor::CrateCollection;
78
use rustdoc_processor::indexing::CrateIndexer;
89
use rustdoc_processor::queries::Crate;
9-
use rustdoc_processor::CrateCollection;
1010

11+
use crate::GenericBindings;
1112
use crate::errors::{TypeResolutionError, UnsupportedConstGeneric};
1213
use crate::resolve_type::resolve_type;
13-
use crate::GenericBindings;
1414

1515
/// Convert an enum or a struct definition from the JSON documentation
1616
/// for a crate into our own representation for types.
1717
///
1818
/// # Panics
1919
///
2020
/// Panics if the item isn't of kind enum or struct.
21-
pub fn rustdoc_new_type_def2type(item: &Item, krate: &Crate) -> Result<Type, UnsupportedConstGeneric> {
21+
pub fn rustdoc_new_type_def2type(
22+
item: &Item,
23+
krate: &Crate,
24+
) -> Result<Type, UnsupportedConstGeneric> {
2225
assert!(
2326
matches!(&item.inner, ItemEnum::Struct(_) | ItemEnum::Enum(_)),
2427
"Unexpected item type, `{}`. Expected a struct or an enum.",

0 commit comments

Comments
 (0)