Skip to content

Commit

Permalink
Clippy and code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Jul 1, 2024
1 parent 0cd0c9a commit 4ffd07e
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions crates/red_knot_python_semantic/src/semantic_index/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl Visitor<'_> for SemanticIndexBuilder<'_> {
);

self.with_type_params(
&name,
name,
&WithTypeParams::FunctionDef {
node: function_def,
id: AstId::new(scope, function_id),
Expand All @@ -256,7 +256,7 @@ impl Visitor<'_> for SemanticIndexBuilder<'_> {

builder.push_scope(
NodeWithScopeId::Function(AstId::new(scope, function_id)),
&name,
name,
Some(symbol),
Some(definition),
);
Expand All @@ -279,7 +279,7 @@ impl Visitor<'_> for SemanticIndexBuilder<'_> {
self.add_or_update_symbol_with_definition(name.clone(), definition),
);
self.with_type_params(
&name,
name,
&WithTypeParams::ClassDef {
node: class,
id: AstId::new(scope, class_id),
Expand All @@ -292,7 +292,7 @@ impl Visitor<'_> for SemanticIndexBuilder<'_> {

builder.push_scope(
NodeWithScopeId::Class(AstId::new(scope, class_id)),
&name,
name,
Some(id),
Some(definition),
);
Expand Down
2 changes: 1 addition & 1 deletion crates/ruff_linter/src/rules/pyflakes/rules/strings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -863,7 +863,7 @@ pub(crate) fn string_dot_format_missing_argument(
.iter()
.filter_map(|k| {
let Keyword { arg, .. } = &k;
arg.as_ref().map(|identifier| identifier.id())
arg.as_ref().map(ruff_python_ast::Identifier::id)
})
.collect();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub(crate) fn repeated_global(checker: &mut Checker, mut suite: &[Stmt]) {
Stmt::Nonlocal(stmt) => &stmt.names,
_ => unreachable!(),
})
.map(|identifier| identifier.id())
.map(ruff_python_ast::Identifier::id)
.format(", ")
),
range,
Expand Down
4 changes: 2 additions & 2 deletions crates/ruff_python_ast/src/name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{nodes, Expr};
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Default)]
#[cfg_attr(
feature = "serde",
derive(serde::Serialize, serde::Deserialize, ruff_macros::CacheKey,)
derive(serde::Serialize, serde::Deserialize, ruff_macros::CacheKey)
)]
pub struct Name(compact_str::CompactString);

Expand All @@ -25,7 +25,7 @@ impl Name {

#[inline]
pub fn new_static(name: &'static str) -> Self {
// TODO: Use ComactString::const_new once we upgrade to 0.8 https://github.com/ParkMyCar/compact_str/pull/336
// TODO(Micha): Use CompactString::const_new once we upgrade to 0.8 https://github.com/ParkMyCar/compact_str/pull/336
Self(compact_str::CompactString::from(name))
}

Expand Down

0 comments on commit 4ffd07e

Please sign in to comment.