如何避免在目录中显示该规则:
\documentclass{article}
\usepackage{fancyhdr,graphicx,blindtext}
\usepackage{geometry}
\usepackage{showframe,fontawesome}
\usepackage{titlesec}
\geometry{nomarginpar,margin = 1in}
\setlength{\headheight}{81pt}
\definecolor{MYCOLOR}{HTML}{6A6A6A}
\definecolor{mycolor}{HTML}{6A6A6A}
\pagestyle{fancy}
\newcommand{\raisedrulefill}[2][0ex]{\leaders\hbox{\rule[#1]{1pt}{#2}}\hfill}
\newcommand{\mysection}[1]{
\titleformat{\section}{
\bfseries
\scshape
\raggedright
\uppercase
}{}{0em}{\llap{\faFile\thinspace\thinspace}}
\section{#1 \color{mycolor}{\raisedrulefill[0.4ex]{1pt}}}
}
\begin{document}
\tableofcontents
\begin{minipage}[t]{0.65\textwidth}
\mysection{foo}
\blindtext
\end{minipage}
\hfill
\begin{minipage}[t]{0.3\textwidth}
\mysection{bar}
\blindtext
\end{minipage}
\end{document}