Browse Source

Fixed some clippy warnings

Robert Bennett 1 year ago
parent
commit
c3e021b820
3 changed files with 4 additions and 7 deletions
  1. 1 1
      numbat/src/decorator.rs
  2. 3 3
      numbat/src/parser.rs
  3. 0 3
      numbat/src/registry.rs

+ 1 - 1
numbat/src/decorator.rs

@@ -125,7 +125,7 @@ pub fn examples(decorators: &[Decorator]) -> Vec<(String, Option<String>)> {
             examples.push((example_code.clone(), example_description.clone()));
         }
     }
-    return examples;
+    examples
 }
 
 pub fn contains_aliases_with_prefixes(decorates: &[Decorator]) -> bool {

+ 3 - 3
numbat/src/parser.rs

@@ -777,8 +777,8 @@ impl<'a> Parser<'a> {
                                     }
 
                                     Decorator::Example(
-                                        strip_and_escape(&token_code.lexeme),
-                                        Some(strip_and_escape(&token_description.lexeme)),
+                                        strip_and_escape(token_code.lexeme),
+                                        Some(strip_and_escape(token_description.lexeme)),
                                     )
                                 } else {
                                     return Err(ParseError {
@@ -795,7 +795,7 @@ impl<'a> Parser<'a> {
                                     ));
                                 }
 
-                                Decorator::Example(strip_and_escape(&token_code.lexeme), None)
+                                Decorator::Example(strip_and_escape(token_code.lexeme), None)
                             }
                         } else {
                             return Err(ParseError {

+ 0 - 3
numbat/src/registry.rs

@@ -24,9 +24,6 @@ pub type Result<T> = std::result::Result<T, RegistryError>;
 
 pub type BaseEntry = String;
 
-#[derive(Debug, Clone, Copy, PartialEq, Eq)]
-pub struct BaseIndex(isize);
-
 #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
 pub struct BaseRepresentationFactor(pub BaseEntry, pub Exponent);