summaryrefslogtreecommitdiffstats
path: root/vendor/gix-config/src/file/write.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 18:31:44 +0000
commitc23a457e72abe608715ac76f076f47dc42af07a5 (patch)
tree2772049aaf84b5c9d0ed12ec8d86812f7a7904b6 /vendor/gix-config/src/file/write.rs
parentReleasing progress-linux version 1.73.0+dfsg1-1~progress7.99u1. (diff)
downloadrustc-c23a457e72abe608715ac76f076f47dc42af07a5.tar.xz
rustc-c23a457e72abe608715ac76f076f47dc42af07a5.zip
Merging upstream version 1.74.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-config/src/file/write.rs')
-rw-r--r--vendor/gix-config/src/file/write.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/vendor/gix-config/src/file/write.rs b/vendor/gix-config/src/file/write.rs
index 29024170d..772054f95 100644
--- a/vendor/gix-config/src/file/write.rs
+++ b/vendor/gix-config/src/file/write.rs
@@ -17,8 +17,8 @@ impl File<'_> {
/// as it was parsed, while writing only sections for which `filter` returns true.
pub fn write_to_filter(
&self,
- mut out: impl std::io::Write,
- mut filter: impl FnMut(&Section<'_>) -> bool,
+ mut out: &mut dyn std::io::Write,
+ mut filter: &mut dyn FnMut(&Section<'_>) -> bool,
) -> std::io::Result<()> {
let nl = self.detect_newline_style();
@@ -65,8 +65,8 @@ impl File<'_> {
/// Stream ourselves to the given `out`, in order to reproduce this file mostly losslessly
/// as it was parsed.
- pub fn write_to(&self, out: impl std::io::Write) -> std::io::Result<()> {
- self.write_to_filter(out, |_| true)
+ pub fn write_to(&self, out: &mut dyn std::io::Write) -> std::io::Result<()> {
+ self.write_to_filter(out, &mut |_| true)
}
}
@@ -76,7 +76,7 @@ pub(crate) fn ends_with_newline(e: &[crate::parse::Event<'_>], nl: impl AsRef<[u
}
e.iter()
.rev()
- .take_while(|e| e.to_bstr_lossy().iter().all(|b| b.is_ascii_whitespace()))
+ .take_while(|e| e.to_bstr_lossy().iter().all(u8::is_ascii_whitespace))
.find_map(|e| e.to_bstr_lossy().contains_str(nl.as_ref()).then_some(true))
.unwrap_or(false)
}