Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5606987rwb; Mon, 14 Nov 2022 07:05:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf63K88qNXC1xUGphxMaVMX/soCSWZvdyD79IMfK3DNmguvLOX9IDl/CFApqd7UaMtqXaxdy X-Received: by 2002:a05:6512:3ba8:b0:4b0:7a03:60dc with SMTP id g40-20020a0565123ba800b004b07a0360dcmr3956913lfv.567.1668438340497; Mon, 14 Nov 2022 07:05:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668438340; cv=none; d=google.com; s=arc-20160816; b=0bKeKxZr7Gx7g2UTtRC3EhWH7IwSTOwOlUJqvClr01gpCXRphOT7AgCrqlBtEjwoMW qTmLOt3aSS/8z8OAhldm/eVzylAAGbd3qDvjQBIQ2mlw4mwHrO9A0Hh4cpfKjcYhIYaf Rbs88ZRtFsfkzeuYcsfhhXq7TdWIpwwI2KfW0Ivz5RU5VVQgeKelY1ZroXy8sqJ0SOki mmtkCoTKuWfv94LLtSEAPExfZ0bnuIUsr1HjDFkNMI0UwX6ecSBujiy5VFOYbKSPIdNj W/PHfXrpk0TgOANxv/hsYLqKztrMFymF5ky0GR/cMCwR+Id98MyOBTQpuw5KyTVyVZ0+ GeFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=3kJuGS5uVSVzPLoxWGsOQFBiLJ7HrhLDmqmpBDrS0NA=; b=ynPlUsYG7PQW1MPQe85Kfx7nn0nY9WfRPxjWenTXV+QkmtcVVwnOd7a/bzBzEc162x DZYt6uj3CxIq4gmeOUn6i8d1JAFHK/+NvoQUD4+pVGMwWkaweZPKBVezRjkRW03cnmRj 4uVOU2KidfMdLTDMS+8b4jXl71px4qq1GLwpPQshLMZOaNj2gxdqoJ0nm/0LZho4cvpH TPBV3IVrOjjTzH2w2fPI2VGIjVQygQznaXV2udv5HESoDHzDdAIJS+TezLcwt4U5p4cC KUVYi0QcmgrN5GT5BxxVIhE5KTP5b3D1iqnyGwLuTKqlkDR1VD9ky407WjuOFXdi9tkL qacw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=fJTfY+Pn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sb1-20020a1709076d8100b00787bacce740si10299990ejc.537.2022.11.14.07.05.11; Mon, 14 Nov 2022 07:05:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=fJTfY+Pn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236248AbiKNOkR (ORCPT + 87 others); Mon, 14 Nov 2022 09:40:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47420 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236721AbiKNOjn (ORCPT ); Mon, 14 Nov 2022 09:39:43 -0500 Received: from mail-4318.protonmail.ch (mail-4318.protonmail.ch [185.70.43.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F8872B1AC for ; Mon, 14 Nov 2022 06:39:35 -0800 (PST) Date: Mon, 14 Nov 2022 14:39:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668436773; x=1668695973; bh=3kJuGS5uVSVzPLoxWGsOQFBiLJ7HrhLDmqmpBDrS0NA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=fJTfY+Pn+ZqZee+nMnAaJCbwPHTnfoPKAv/qf7IIWScErzoVWFnp2pfEWWeIFYhHd ///1e33rt6sdUzzuUe9+FtQ2p9DcwSKdhrUMH0FM9GMCj2FyjgJAp1RBwMIMM5lLLd 9Z2mTknOdkKuJ48KpYoZXOUu1/xeqRMTXofjDXyQr3NKCJdWslgHUqF6o0wemlOuCC 4r/B5htHpS8e3qV84LYyr1rgRYnE9kDI+LwfV/rEm6nbpLBVPCVrAfduasdn6Aw3h3 +eDyPYWqDP53CMbqT2lf/u9usEzh3NIpuemJWp1X5En+NX3QApYb/0WIhvnpjDoQv6 tZwLblJRB2kDA== To: Gary Guo From: =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= Cc: Miguel Ojeda , Wedson Almeida Filho , Alex Gaynor , Boqun Feng , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev Subject: Re: [PATCH v1 05/28] rust: macros: add `concat_idents!` proc macro Message-ID: <_CF9aCGri4-OVipaa-ZySoRbBu17nlThYL3fGiHugcWQNAjgtE-ZBcekhmg_pM6uNGWsSuqoke-pGPgB7ZlGCI1Iyo_bl4RhtzfbdI0Z18g=@protonmail.com> In-Reply-To: <20221114142611.2a21d4e9@GaryWorkstation> References: <20221110164152.26136-1-ojeda@kernel.org> <20221110164152.26136-6-ojeda@kernel.org> <20221114142611.2a21d4e9@GaryWorkstation> Feedback-ID: 27884398:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday, November 14th, 2022 at 15:26, Gary Guo wrote: > On Thu, 10 Nov 2022 17:41:17 +0100 > Miguel Ojeda ojeda@kernel.org wrote: >=20 > > +pub(crate) fn concat_idents(ts: TokenStream) -> TokenStream { > > + let mut it =3D ts.into_iter(); > > + let a =3D expect_ident(&mut it); > > + assert_eq!(expect_punct(&mut it), ','); > > + let b =3D expect_ident(&mut it); > > + assert!(it.next().is_none(), "only two idents can be concatenated"); > > + let res =3D Ident::new(&(a.to_string() + &b.to_string()), b.span()); >=20 >=20 > Probably clearer to write `Ident::new(&format!("{a}{b}"), b.span())` > here? >=20 > Best, > Gary I agree that is clearer. I hadn't considered that Ident implements Display = when I wrote it. Cheers, Bj=C3=B6rn