mozilla / mtu

Rust crate for obtaining the local network interface name and MTU towards a given IP address
https://crates.io/crates/mtu
Apache License 2.0
12 stars 2 forks source link

doc: Add an example #6

Closed larseggert closed 1 month ago

codecov-commenter commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 94.55%. Comparing base (607f703) to head (473763d).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #6 +/- ## ======================================= Coverage 94.55% 94.55% ======================================= Files 1 1 Lines 202 202 ======================================= Hits 191 191 Misses 11 11 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

larseggert commented 1 month ago

@mxinden CI now fails after merging #5, could you check?

mxinden commented 1 month ago

It is failing on the doc test introduced in this pull request. I will take a look why that is the case.

mxinden commented 1 month ago

@larseggert can you try the following:

modified   .github/workflows/check.yml
@@ -88,7 +88,7 @@ jobs:

           for sanitizer in $SANITIZERS; do
             echo "Running tests with $sanitizer sanitizer..."
-            RUSTFLAGS="-Z sanitizer=$sanitizer" cargo +nightly test -Z build-std --target $TARGET
+            RUSTFLAGS="-Z sanitizer=$sanitizer" RUSTDOCFLAGS="-Z sanitizer=$sanitizer" cargo +nightly test -Z build-std --target $TARGET
           done
mxinden commented 1 month ago
test src/lib.rs - get_interface_mtu (line 32) ... ok

Seems to work.

mxinden commented 1 month ago

I don't think the latest commit will compile. See https://github.com/mozilla/mtu/pull/6#discussion_r1741020895 in case it is already hidden by GitHub UI.

Edit: Never mind. I didn't see the additional imports. Sorry for the noise.