unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] avoid wrong/needless squote_maybe shortcuts
Date: Sun, 18 Apr 2021 08:31:39 +0000	[thread overview]
Message-ID: <20210418083139.31310-1-e@80x24.org> (raw)

We'll keep it in PublicInbox::Config for now, since I'm not
sure if there's a better place to put it.
---
 lib/PublicInbox/LeiSavedSearch.pm | 4 +---
 t/reply.t                         | 5 +++--
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/lib/PublicInbox/LeiSavedSearch.pm b/lib/PublicInbox/LeiSavedSearch.pm
index f40fe76b..3076d14c 100644
--- a/lib/PublicInbox/LeiSavedSearch.pm
+++ b/lib/PublicInbox/LeiSavedSearch.pm
@@ -13,8 +13,6 @@ use PublicInbox::Spawn qw(run_die);
 use PublicInbox::ContentHash qw(git_sha);
 use Digest::SHA qw(sha256_hex);
 
-*squote_maybe = \&PublicInbox::Config::squote_maybe;
-
 # move this to PublicInbox::Config if other things use it:
 my %cquote = ("\n" => '\\n', "\t" => '\\t', "\b" => '\\b');
 sub cquote_val ($) { # cf. git-config(1)
@@ -61,7 +59,7 @@ sub new {
 		$self->{-cfg} = {};
 		my $f = $self->{'-f'} = "$dir/lei.saved-search";
 		open my $fh, '>', $f or return $lei->fail("open $f: $!");
-		my $sq_dst = squote_maybe($dst);
+		my $sq_dst = PublicInbox::Config::squote_maybe($dst);
 		my $q = $lei->{mset_opt}->{q_raw} // die 'BUG: {q_raw} missing';
 		if (ref $q) {
 			$q = join("\n", map { "\tq = ".cquote_val($_) } @$q);
diff --git a/t/reply.t b/t/reply.t
index 1e89973e..41d72db2 100644
--- a/t/reply.t
+++ b/t/reply.t
@@ -1,8 +1,9 @@
+#!perl -w
 # Copyright (C) 2017-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
-use warnings;
 use Test::More;
+use PublicInbox::Config;
 use PublicInbox::Eml;
 use_ok 'PublicInbox::Reply';
 
@@ -15,7 +16,7 @@ my @q = (
 while (@q) {
 	my $input = shift @q;
 	my $expect = shift @q;
-	my $res = PublicInbox::Reply::squote_maybe($input);
+	my $res = PublicInbox::Config::squote_maybe($input);
 	is($res, $expect, "quote $input => $res");
 }
 

                 reply	other threads:[~2021-04-18  8:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://public-inbox.org/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210418083139.31310-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=meta@public-inbox.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).