Remove unused ScopeGuarding trait

As of commit 0441bdc634 (Remove ScopeGuard::commit in favor of drop,
2026-04-30), this trait is empty so there's not much use having it
for now.
This commit is contained in:
Johannes Altmanninger
2026-05-02 22:26:48 +08:00
parent 6705d27f93
commit 638777a4de
3 changed files with 10 additions and 20 deletions

View File

@@ -30,8 +30,7 @@
};
use assert_matches::assert_matches;
use fish_common::{
EscapeFlags, EscapeStringStyle, FilenameRef, ScopeGuarding, ScopedCell, ScopedRefCell,
escape_string,
EscapeFlags, EscapeStringStyle, FilenameRef, ScopedCell, ScopedRefCell, escape_string,
};
use fish_util::get_time;
use fish_widestring::{WExt as _, wcs2bytes};
@@ -41,6 +40,7 @@
use std::fs::File;
use std::io::Write as _;
use std::num::NonZeroU32;
use std::ops::DerefMut;
use std::rc::Rc;
use std::sync::Arc;
use std::time::Duration;
@@ -906,10 +906,7 @@ pub fn scope(&self) -> ScopedData {
/// Modify the scoped values for the duration of the caller's scope (or whenever the ParserScope is dropped).
/// This accepts a closure which modifies the ScopedData, and returns a ParserScope which restores the
/// data when dropped.
pub fn push_scope<'a, F: FnOnce(&mut ScopedData)>(
&'a self,
modifier: F,
) -> impl ScopeGuarding + 'a {
pub fn push_scope<'a, F: FnOnce(&mut ScopedData)>(&'a self, modifier: F) -> impl DerefMut + 'a {
self.scoped_data.scoped_mod(modifier)
}

View File

@@ -111,8 +111,8 @@
use assert_matches::assert_matches;
use errno::{Errno, errno};
use fish_common::{
EscapeFlags, EscapeStringStyle, ScopeGuard, ScopeGuarding, escape, escape_string,
escape_string_with_quote, exit_without_destructors, get_obfuscation_read_char, help_section,
EscapeFlags, EscapeStringStyle, ScopeGuard, escape, escape_string, escape_string_with_quote,
exit_without_destructors, get_obfuscation_read_char, help_section,
restore_term_foreground_process_group_for_exit, write_loop,
};
use fish_fallback::{fish_wcwidth, lowercase};
@@ -143,7 +143,7 @@
cmp,
io::BufReader,
num::NonZeroUsize,
ops::{ControlFlow, Range},
ops::{ControlFlow, DerefMut, Range},
os::fd::{AsRawFd as _, BorrowedFd, FromRawFd as _, OwnedFd, RawFd},
pin::Pin,
sync::{
@@ -424,7 +424,7 @@ pub fn reader_pop() {
}
}
pub fn fake_scoped_reader<'a>(parser: &'a Parser) -> impl ScopeGuarding<Target = Reader<'a>> + 'a {
pub fn fake_scoped_reader<'a>(parser: &'a Parser) -> impl DerefMut<Target = Reader<'a>> + 'a {
let inputfd = -1;
let conf = ReaderConfig {
inputfd,