lint fixes

This commit is contained in:
Vinzenz Schroeter 2025-04-24 22:30:57 +02:00
parent ad8b48fbc3
commit deb067b2b7
2 changed files with 7 additions and 6 deletions

View file

@ -183,7 +183,7 @@ The first thing I noticed was that I got some new warnings when compiling, all o
Next up, I added cargo-bloat to my flake. This tool can show you which functions take up most of the space in your binary.
The invocation is similar to building - `cargo bloat --example announce --profile=size-optimized` resulted in the following output:
```
```text
File .text Size Crate Name
1.0% 5.5% 21.0KiB clap_builder clap_builder::parser::parser::Parser::get_matches_with
0.9% 5.3% 20.5KiB std std::backtrace_rs::symbolize::gimli::Cache::with_global
@ -226,7 +226,7 @@ Using `GNU size`, we can check the size per section in the ELF binary.
Using `-G` or `-B` output formats does not work for this, as it will only show the `.text` and `.data` section, which in this case only make up around 500KB.
Thus the command I used was `size -A --common target/size-optimized/examples/announce`, giving the following result:
```
```text
section size addr
.dynsym 1680 856
.dynstr 1198 3500
@ -260,7 +260,8 @@ While clap is super handy, it looks like the code needed to parse two simple arg
As the C program I was comparing against had all the parameters hard-coded, I just ripped out the dependency and hard-coded the values I needed.
The result is the first version of `tiny_announce`, as I did not want to change the existing example.
```
```rust
//! An example for how to send text to the display.
use servicepoint::{
@ -308,7 +309,7 @@ This produces a binary that is now only 30.992 bytes!
The remaining top 3 functions were:
```
```text
File .text Size Crate Name
4.4% 11.0% 2.0KiB std <&T as std::net::socket_addr::ToSocketAddrs>::to_socket_addrs
3.8% 9.4% 1.7KiB tiny_announce tiny_announce::main