Skip to content

Fix warnings in xml5ever #315

Closed
Closed

Description

@jdm
warning: unused macro definition
   --> target/package/xml5ever-0.11.0/src/tokenizer/mod.rs:609:1
    |
609 | / macro_rules! go_match ( ( $me:ident : $x:expr, $($pats:pat),+ => $($cmds:tt)* ) => (
610 | |     match $x {
611 | |         $($pats)|+ => go!($me: $($cmds)*),
612 | |         _ => (),
613 | |     }
614 | | ));
    | |___^
    |
    = note: #[warn(unused_macros)] on by default

warning: unused macro definition
   --> target/package/xml5ever-0.11.0/src/tokenizer/mod.rs:622:1
    |
622 | / macro_rules! peek ( ($me:expr) => (
623 | |     unwrap_or_return!($me.peek(), false)
624 | | ));
    | |___^

warning: variable does not need to be mutable
   --> target/package/xml5ever-0.11.0/src/tree_builder/mod.rs:359:13
    |
359 |         for mut attr in tag.attrs.iter_mut()
    |             ---^^^^^
    |             |
    |             help: remove this `mut`
    |
    = note: #[warn(unused_mut)] on by default

Activity

  1. milindjain0 commented on Oct 19, 2017

    @milindjain0
    Contributor

    I would like to work on this. I am new to this and help from a mentor for getting started would be appreciated.

    Thanks

  2. SimonSapin commented on Oct 19, 2017

    @SimonSapin
    Member

    Hi @milindjain0. Are you familiar with GitHub’s pull request workflow?

    After cloning this repository, you can run cargo build to compile everything. You should see the same warnings as above. Then change the code until you can compile without warnings, and send a pull request.

    For the unused macros, double check that they don’t have a #[macro_export] attribute above them. This would make them available to users outside the crate, in which case we wouldn’t want to remove them. But I think the warning wouldn’t be shown in that case. You should be able to remove these two macros and have everything still compile.

    As to the variable that doesn’t need to be mutable, the warning itself suggests a fix: removing mut in for mut attr in tag.attrs.iter_mut().

    Feel free to ask any question here on on the #servo channel on Mozilla IRC.

  3. milindjain0 commented on Oct 21, 2017

    @milindjain0
    Contributor

    Hi,

    I was able to build the code using ./mach build -d and run using ./mach run ...

    I am not able to use cargo

    Do I need to set environment variables for using Cargo?

    And durring ./mach build -d I did not get any warning

    Thanks

  4. KiChjang commented on Oct 21, 2017

    @KiChjang
    Contributor

    @milindjain0 You shouldn't be using mach for this issue, let alone this repository. What you need to do is clone html5ever, cd into it and run cargo build as @SimonSapin has outlined above.

  5. milindjain0 commented on Oct 21, 2017

    @milindjain0
    Contributor

    @KiChjang I cloned html5ever and tried cargo build but I am getting no command found I have not installed rust and cargo currently How do I know the version which needs to be installed?

    Since I was able to build using ./mach build -d. Rust would have been installed

    Can you let me know what is the default location in Mac?

    Thanks

  6. jdm commented on Oct 21, 2017

    @jdm
    MemberAuthor

    @milindjain0 Servo's build system installs a very specific version of rust in a particular place. I recommend following the regular Rust installation steps at https://www.rust-lang.org/en-US/install.html.

  7. milindjain0 commented on Oct 21, 2017

    @milindjain0
    Contributor

    @jdm @KiChjang @SimonSapin Thanks Everything is working fine now!

  8. duxum commented on Oct 23, 2017

    @duxum

    Was playing with this and I did as @SimonSapin wrote, and there are no longer warnings. Should I go ahead and PR.
    Thanks,

  9. KiChjang commented on Oct 23, 2017

    @KiChjang
    Contributor

    @duxum Sorry, but isn't @milindjain0 already working on this issue?

  10. duxum commented on Oct 23, 2017

    @duxum

    @KiChjang Okay, no problem. However, I guess a tag that it is assigned should be added.

  11. milindjain0 commented on Oct 24, 2017

    @milindjain0
    Contributor

    @KiChjang @SimonSapin @jdm I have made a PR after making the changes to remove the warning and cargo build is working

  12. added a commit that references this issue on Oct 24, 2017
  13. milindjain0 commented on Oct 24, 2017

    @milindjain0
    Contributor

    @jdm @KiChjang @SimonSapin Can you suggest some other issue to work on or some feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions