Skip to content

Commit 0c4dfa4

Browse files
committed
Linter fixes and cleanup
println still present
1 parent e05c6d2 commit 0c4dfa4

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

src/getter.rs

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -525,15 +525,6 @@ impl Getter for JavaCode {
525525
}
526526
}
527527

528-
// fn get_func_space_name<'a>(node: &Node, code: &'a [u8]) -> Option<&'a str> {
529-
// if let Some(name) = node.object().child_by_field_name("name") {
530-
// let code = &code[name.start_byte()..name.end_byte()];
531-
// std::str::from_utf8(code).ok()
532-
// } else {
533-
// Some("<anonymous>")
534-
// }
535-
// }
536-
537528
fn get_op_type(node: &Node) -> HalsteadType {
538529
use Java::*;
539530

@@ -554,11 +545,6 @@ impl Getter for JavaCode {
554545
let typ = node.object().kind_id();
555546

556547
match typ.into() {
557-
// LPAREN | COMMA | STAR | GTGT | COLON | SEMI | Return | Break | Continue | If | Else
558-
// | Switch | Case | Default | For | While | New | Try | Catch | Throw | Throws
559-
// | Throws2 | EQ | EQEQ | AMP | AMPAMP | AMPEQ | LT | LTLT | LTEQ | LTLTEQ | BANGEQ
560-
// | GTEQ | GTGTEQ | GTGTGT | GTGTGTEQ | PLUSEQ | BANG | STAREQ | SLASHEQ | PERCENTEQ
561-
// | CARET | CARETEQ | LBRACE | RBRACE | QMARK | Instanceof
562548
// Operator: function calls
563549
MethodInvocation
564550
// Operator: control flow
@@ -575,17 +561,17 @@ impl Getter for JavaCode {
575561
// type identifier
576562
| TypeIdentifier | IntegralType | FloatingPointType | BooleanType
577563
=> {
578-
println!("operator: {}", node.object().kind().to_string());
564+
println!("operator: {}", node.object().kind());
579565
HalsteadType::Operator
580566
},
581567

582568
// Operands: variables, constants, literals
583569
Identifier | NullLiteral | ClassLiteral | StringLiteral | CharacterLiteral | HexIntegerLiteral | OctalIntegerLiteral | BinaryIntegerLiteral | DecimalIntegerLiteral | HexFloatingPointLiteral | DecimalFloatingPointLiteral => {
584-
println!("operand: {} ", node.object().kind().to_string());
570+
println!("operand: {} ", node.object().kind());
585571
HalsteadType::Operand
586572
},
587573
_ => {
588-
println!("unknown: {} ", node.object().kind().to_string());
574+
println!("unknown: {} ", node.object().kind());
589575
HalsteadType::Unknown
590576
},
591577
}

0 commit comments

Comments
 (0)