Skip to content

Commit 6053477

Browse files
justinbayorizi
andauthored
refactor: remove redundant string allocations and dead code attributes (#8738)
Co-authored-by: Ori Ziv <[email protected]> Co-authored-by: orizi <[email protected]>
1 parent 70e5a5b commit 6053477

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

crates/cairo-lang-debug/src/debug.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ pub trait DebugWithDb<'db> {
2121
DebugWith { value: BoxRef::Ref(self), db }
2222
}
2323

24-
#[allow(dead_code)]
2524
fn into_debug<'me>(self, db: &'db Self::Db) -> DebugWith<'me, 'db, Self::Db>
2625
where
2726
Self: Sized + 'me,

crates/cairo-lang-parser/src/colored_printer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,16 @@ impl ColoredPrinter<'_> {
1616
match &node.details {
1717
GreenNodeDetails::Token(text) => {
1818
if self.verbose && node.kind == SyntaxKind::TokenMissing {
19-
self.result.push_str(format!("{}", "<m>".red()).as_str());
19+
self.result.push_str(&format!("{}", "<m>".red()));
2020
} else {
2121
self.result.push_str(&set_color(text.long(self.db), node.kind).to_string());
2222
}
2323
}
2424
GreenNodeDetails::Node { .. } => {
2525
if self.verbose && is_missing_kind(node.kind) {
26-
self.result.push_str(format!("{}", "<m>".red()).as_str());
26+
self.result.push_str(&format!("{}", "<m>".red()));
2727
} else if self.verbose && is_empty_kind(node.kind) {
28-
self.result.push_str(format!("{}", "<e>".red()).as_str());
28+
self.result.push_str(&format!("{}", "<e>".red()));
2929
} else {
3030
for child in syntax_node.get_children(self.db).iter() {
3131
self.print(child);

0 commit comments

Comments
 (0)