Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove questionable unsafe impl Send #869

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/completion/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ const SELECTION_CHAR: char = '!';
// It pulls data from the object that contains access to the History
pub(crate) struct HistoryCompleter<'menu>(&'menu dyn History);

// Safe to implement Send since the HistoryCompleter should only be used when
// updating the menu and that must happen in the same thread
unsafe impl Send for HistoryCompleter<'_> {}

fn search_unique(
completer: &HistoryCompleter,
line: &str,
Expand Down
2 changes: 1 addition & 1 deletion src/history/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ impl SearchQuery {

/// Represents a history file or database
/// Data could be stored e.g. in a plain text file, in a `JSONL` file, in a `SQLite` database
pub trait History: Send {
pub trait History: Send + Sync {
/// save a history item to the database
/// if given id is None, a new id is created and set in the return value
/// if given id is Some, the existing entry is updated
Expand Down
Loading