diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-03-04 17:16:11 -0500 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-03-04 17:16:11 -0500 |
commit | 6a0fabc6472f49621260de215f128a31ae70219b (patch) | |
tree | 6a67908358a2c5e5baa215fe0201dfe213dd8a01 /mesonbuild/compilers/rust.py | |
parent | 4340bf34faca7eed8076ba4c388fbe15355f2183 (diff) | |
download | meson-6a0fabc6472f49621260de215f128a31ae70219b.zip meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.gz meson-6a0fabc6472f49621260de215f128a31ae70219b.tar.bz2 |
mass rewrite of string formatting to use f-strings everywhere
performed by running "pyupgrade --py36-plus" and committing the results
Diffstat (limited to 'mesonbuild/compilers/rust.py')
-rw-r--r-- | mesonbuild/compilers/rust.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index fd58819..7354d58 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -80,7 +80,7 @@ class RustCompiler(Compiler): stdo = _stdo.decode('utf-8', errors='replace') stde = _stde.decode('utf-8', errors='replace') if pc.returncode != 0: - raise EnvironmentException('Rust compiler %s can not compile programs.\n%s\n%s' % ( + raise EnvironmentException('Rust compiler {} can not compile programs.\n{}\n{}'.format( self.name_string(), stdo, stde)) @@ -119,7 +119,7 @@ class RustCompiler(Compiler): if i[:2] == '-L': for j in ['dependency', 'crate', 'native', 'framework', 'all']: combined_len = len(j) + 3 - if i[:combined_len] == '-L{}='.format(j): + if i[:combined_len] == f'-L{j}=': parameter_list[idx] = i[:combined_len] + os.path.normpath(os.path.join(build_dir, i[combined_len:])) break @@ -130,7 +130,7 @@ class RustCompiler(Compiler): @classmethod def use_linker_args(cls, linker: str) -> T.List[str]: - return ['-C', 'linker={}'.format(linker)] + return ['-C', f'linker={linker}'] # Rust does not have a use_linker_args because it dispatches to a gcc-like # C compiler for dynamic linking, as such we invoke the C compiler's |