Eugeny / russh

Rust SSH client & server library
https://docs.rs/russh
970 stars 112 forks source link

Improve echoserver example, bump Rust toolchain to 1.81 #339

Closed JuliDi closed 2 months ago

JuliDi commented 2 months ago

While trying out the echoserver, I've added some error handling and made the session closable with ctrl+c, which might often be what you want. So I thought upstreaming these changes might be a good thing.

While on it, I took the liberty of bumping the rust toolchain to 1.81, which does not seem to break anything.

JuliDi commented 2 months ago

There is still a clippy lint regarding unused struct fields:

warning: fields `key` and `algo` are never read
   --> russh/src/auth.rs:140:9
    |
139 |     PublicKey {
    |     --------- fields in this variant
140 |         key: CryptoVec,
    |         ^^^
141 |         algo: CryptoVec,
    |         ^^^^
    |
    = note: `CurrentRequest` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis
    = note: `#[warn(dead_code)]` on by default

Not sure what that struct is used for and how to fix it. Maybe allow dead_code in there? Or prefix with an underscore?

Regarding rustfmt: should we use a nightly toolchain to run rustfmt? There are still some warnings about nightly-only features.

Eugeny commented 2 months ago

Thanks! Yes, the nightly rustfmt is still needed for imports_granularity etc.

Eugeny commented 2 months ago

@all-contributors add @JuliDi for code

allcontributors[bot] commented 2 months ago

@Eugeny

I've put up a pull request to add @JuliDi! :tada: