Skip to content

Commit 1fc1615

Browse files
committed
impl block
1 parent 86319a2 commit 1fc1615

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

crates/ty_python_semantic/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ use crate::unpack::EvaluationMode;
7878
use crate::{Db, FxOrderSet, Program};
7979
pub use class::KnownClass;
8080
pub(crate) use class::{ClassLiteral, ClassType, GenericAlias, StaticClassLiteral};
81-
pub use instance::{NominalInstanceType, ProtocolInstanceType};
8281
use instance::Protocol;
82+
pub use instance::{NominalInstanceType, ProtocolInstanceType};
8383
pub use special_form::SpecialFormType;
8484

8585
mod bound_super;

crates/ty_python_semantic/src/types/subscript.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ use itertools::Itertools;
22
use ruff_python_ast as ast;
33

44
use crate::place::{DefinedPlace, Definedness, Place};
5+
use crate::semantic_index::SemanticIndex;
56
use crate::semantic_index::definition::Definition;
67
use crate::semantic_index::scope::ScopeId;
7-
use crate::semantic_index::SemanticIndex;
88
use crate::subscript::{PyIndex, PySlice};
99
use crate::{Db, FxOrderSet};
1010

@@ -23,7 +23,9 @@ use super::instance::SliceLiteral;
2323
use super::special_form::SpecialFormType;
2424
use super::tuple::{Tuple, TupleSpec};
2525
use super::visitor::any_over_type;
26-
use super::{DynamicType, KnownInstanceType, Type, TypeAliasType, UnionBuilder, UnionType, todo_type};
26+
use super::{
27+
DynamicType, KnownInstanceType, Type, TypeAliasType, UnionBuilder, UnionType, todo_type,
28+
};
2729

2830
#[derive(Debug)]
2931
pub(crate) struct SubscriptError<'db> {
@@ -32,7 +34,7 @@ pub(crate) struct SubscriptError<'db> {
3234
}
3335

3436
#[derive(Debug)]
35-
pub(crate) enum SubscriptErrorKind<'db> {
37+
enum SubscriptErrorKind<'db> {
3638
/// An index is out of bounds for a literal tuple/string/bytes subscript.
3739
IndexOutOfBounds {
3840
kind: &'static str,
@@ -81,14 +83,14 @@ pub(crate) enum SubscriptErrorKind<'db> {
8183
}
8284

8385
impl<'db> SubscriptError<'db> {
84-
pub(super) fn new(result_ty: Type<'db>, error: SubscriptErrorKind<'db>) -> Self {
86+
fn new(result_ty: Type<'db>, error: SubscriptErrorKind<'db>) -> Self {
8587
Self {
8688
result_ty,
8789
errors: vec![error],
8890
}
8991
}
9092

91-
pub(super) fn with_errors(result_ty: Type<'db>, errors: Vec<SubscriptErrorKind<'db>>) -> Self {
93+
fn with_errors(result_ty: Type<'db>, errors: Vec<SubscriptErrorKind<'db>>) -> Self {
9294
Self { result_ty, errors }
9395
}
9496

@@ -253,7 +255,7 @@ impl<'db> SubscriptErrorKind<'db> {
253255
}
254256
}
255257

256-
pub(super) fn map_union_subscript<'db, F>(
258+
fn map_union_subscript<'db, F>(
257259
db: &'db dyn Db,
258260
union: UnionType<'db>,
259261
mut map_fn: F,

0 commit comments

Comments
 (0)