git: 2e8418910610 - main - net-mgmt/gping: Fix build with rust 1.74

From: Mikael Urankar <mikael_at_FreeBSD.org>
Date: Fri, 08 Dec 2023 15:05:06 UTC
The branch main has been updated by mikael:

URL: https://cgit.FreeBSD.org/ports/commit/?id=2e841891061001aaf5d62a966a568563835d5cb9

commit 2e841891061001aaf5d62a966a568563835d5cb9
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2023-11-21 08:43:03 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2023-12-08 15:02:42 +0000

    net-mgmt/gping: Fix build with rust 1.74
    
    Import upstream patch [1] to fix the following error:
    error[E0283]: type annotations needed
       --> gping/src/main.rs:486:26
        |
    486 |                         .constraints(
        |                          ^^^^^^^^^^^ cannot infer type of the type parameter `C` declared on the method `constraints`
    ...
    491 |                                 .as_ref(),
        |                                  ------ type must be known at this point
        |
        = note: multiple `impl`s satisfying `Vec<Constraint>: AsRef<_>` found in the `alloc` crate:
                - impl<T, A> AsRef<Vec<T, A>> for Vec<T, A>
                  where A: Allocator;
                - impl<T, A> AsRef<[T]> for Vec<T, A>
                  where A: Allocator;
    help: consider specifying the generic argument
        |
    486 |                         .constraints::<&T>(
        |                                     ++++++
    
    [1] https://github.com/orf/gping/commit/7ad129c979b48cbea8b1c64ddf37e71da7f00d13
    
    PR:             275243
    Approved by:    portmgr (build fix blanket)
---
 net-mgmt/gping/files/patch-rust-1.74.0 | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/net-mgmt/gping/files/patch-rust-1.74.0 b/net-mgmt/gping/files/patch-rust-1.74.0
new file mode 100644
index 000000000000..0af07c3973ac
--- /dev/null
+++ b/net-mgmt/gping/files/patch-rust-1.74.0
@@ -0,0 +1,15 @@
+https://github.com/orf/gping/pull/395
+https://github.com/orf/gping/commit/7ad129c979b48cbea8b1c64ddf37e71da7f00d13
+
+--- gping/src/main.rs.orig	2023-11-07 15:32:02 UTC
++++ gping/src/main.rs
+@@ -487,8 +487,7 @@ fn main() -> Result<()> {
+                             iter::repeat(Constraint::Length(1))
+                                 .take(app.data.len())
+                                 .chain(iter::once(Constraint::Percentage(10)))
+-                                .collect::<Vec<_>>()
+-                                .as_ref(),
++                                .collect::<Vec<_>>(),
+                         )
+                         .split(f.size());
+