Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Mar 4, 2021. It is now read-only.

Conversation

larsborn
Copy link

While tests are still passing, this patch changes the following things:

  • remove a few obsolete paranthesis
  • add a few implicit dyn keywords
  • convert a doc comment to a regular one
  • remove an obsolete semicolon

The following warnings appeared before the patch:

warning: unused doc comment
   --> src/elf.rs:606:9
    |
606 | /         ///TODO this is shitty, because we need to replicate all the alignment code
607 | |         ///also most of those sections dont actually need to be moved
    | |_____________________________________________________________________^
608 | /         for sec in &mut self.sections[1..] {
609 | |             if sec.header.addralign > 0 {
610 | |                 let oa = hoff % sec.header.addralign;
611 | |                 if oa != 0 {
...   |
614 | |             }
615 | |         }
    | |_________- rustdoc does not generate documentation for expressions
    |
    = note: `#[warn(unused_doc_comments)]` on by default

warning: unnecessary parentheses around type
   --> src/dynamic.rs:109:17
    |
109 |     ) -> Result<(usize), Error>
    |                 ^^^^^^^ help: remove these parentheses
    |
    = note: `#[warn(unused_parens)]` on by default

warning: unnecessary parentheses around type
   --> src/elf.rs:682:59
    |
682 |     pub fn remove_section(&mut self, at: usize) -> Result<(Section), Error> {
    |                                                           ^^^^^^^^^ help: remove these parentheses

warning: trait objects without an explicit `dyn` are deprecated
  --> src/loader.rs:39:30
   |
39 |         read:    RefCell<Box<ReadSeekSend>>,
   |                              ^^^^^^^^^^^^ help: use `dyn`: `dyn ReadSeekSend`
   |
   = note: `#[warn(bare_trait_objects)]` on by default

warning: trait objects without an explicit `dyn` are deprecated
   --> src/loader.rs:233:50
    |
233 |     fn make_object(name: String, io: RefCell<Box<ReadSeekSend>>) -> Result<State, Error> {
    |                                                  ^^^^^^^^^^^^ help: use `dyn`: `dyn ReadSeekSend`

warning: unnecessary parentheses around type
   --> src/relocation.rs:180:17
    |
180 |     ) -> Result<(usize), Error>
    |                 ^^^^^^^ help: remove these parentheses

warning: unnecessary parentheses around type
   --> src/symbol.rs:173:17
    |
173 |     ) -> Result<(usize), Error>
    |                 ^^^^^^^ help: remove these parentheses

warning: unnecessary trailing semicolon
   --> bin/ld.rs:627:91
    |
627 |             .find(|&(_,s)|s.bind == types::SymbolBind::GLOBAL).map(|(i,_)|i).unwrap_or(0);;
    |                                                                                           ^ help: remove this semicolon
    |
    = note: `#[warn(redundant_semicolon)]` on by default

    Finished release [optimized] target(s) in 0.03s 

this patch does three things
* remove a few obsolete paranthesis
* add a few implicit dyn keywords
* convert a doc comment to a regular one
* remove an obsolete semicolon
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant