Commit 56f03c1
Do not use which if which-rustfmt feature is disabled
This commit changes the API of rustfmt_path to return Result<Option<Cow<PathBuf>>>.
Ok(None) is returned in the case where which is disabled and no rustfmt command is
supplied explicitly either via configuration or env variable.
Downstream code checks for the presence of None to directly return the source without
emitting an error.1 parent b8b1fe2 commit 56f03c1
1 file changed
+13
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
1900 | 1901 | | |
1901 | 1902 | | |
1902 | 1903 | | |
1903 | | - | |
| 1904 | + | |
1904 | 1905 | | |
1905 | 1906 | | |
1906 | | - | |
| 1907 | + | |
1907 | 1908 | | |
1908 | 1909 | | |
1909 | | - | |
| 1910 | + | |
1910 | 1911 | | |
| 1912 | + | |
1911 | 1913 | | |
1912 | | - | |
| 1914 | + | |
1913 | 1915 | | |
1914 | 1916 | | |
| 1917 | + | |
| 1918 | + | |
1915 | 1919 | | |
1916 | 1920 | | |
1917 | 1921 | | |
| |||
1926 | 1930 | | |
1927 | 1931 | | |
1928 | 1932 | | |
1929 | | - | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
1930 | 1938 | | |
1931 | 1939 | | |
1932 | 1940 | | |
| |||
0 commit comments