mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-04 07:25:44 +03:00
move default_true type to the only place where its relevant
We dont really want this type to spread through the codebase
This commit is contained in:
parent
3be7d600e0
commit
bf373c5d8f
5
Cargo.lock
generated
5
Cargo.lock
generated
@ -2177,24 +2177,19 @@ dependencies = [
|
||||
"git2",
|
||||
"git2-hooks",
|
||||
"gitbutler-git",
|
||||
"gitbutler-testsupport",
|
||||
"gix",
|
||||
"glob",
|
||||
"hex",
|
||||
"itertools 0.13.0",
|
||||
"keyring",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"md5",
|
||||
"once_cell",
|
||||
"pretty_assertions",
|
||||
"rand 0.8.5",
|
||||
"regex",
|
||||
"reqwest 0.12.5",
|
||||
"resolve-path",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serial_test",
|
||||
"sha2",
|
||||
"ssh-key",
|
||||
"ssh2",
|
||||
|
@ -5,18 +5,6 @@ edition = "2021"
|
||||
authors = ["GitButler <gitbutler@gitbutler.com>"]
|
||||
publish = false
|
||||
|
||||
[[test]]
|
||||
name = "core"
|
||||
path = "tests/core.rs"
|
||||
|
||||
[dev-dependencies]
|
||||
once_cell = "1.19"
|
||||
pretty_assertions = "1.4"
|
||||
gitbutler-testsupport.workspace = true
|
||||
gitbutler-git = { workspace = true, features = ["test-askpass-path"] }
|
||||
glob = "0.3.1"
|
||||
serial_test = "3.1.1"
|
||||
|
||||
[dependencies]
|
||||
toml = "0.8.13"
|
||||
anyhow = "1.0.86"
|
||||
|
@ -1,4 +1,2 @@
|
||||
pub mod default_true;
|
||||
|
||||
mod tagged_string;
|
||||
pub use tagged_string::*;
|
||||
|
@ -1 +0,0 @@
|
||||
mod types;
|
@ -1,19 +0,0 @@
|
||||
use gitbutler_core::types::default_true::DefaultTrue;
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::bool_assert_comparison)]
|
||||
fn default_true() {
|
||||
let default_true = DefaultTrue::default();
|
||||
assert!(default_true);
|
||||
assert_eq!(default_true, true);
|
||||
assert_eq!(!default_true, false);
|
||||
assert!(!!default_true);
|
||||
|
||||
if !(*default_true) {
|
||||
unreachable!("default_true is false")
|
||||
}
|
||||
|
||||
let mut default_true = DefaultTrue::default();
|
||||
*default_true = false;
|
||||
assert!(!default_true);
|
||||
}
|
@ -88,3 +88,21 @@ impl core::ops::Not for DefaultTrue {
|
||||
!self.0
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[allow(clippy::bool_assert_comparison)]
|
||||
fn default_true() {
|
||||
let default_true = DefaultTrue::default();
|
||||
assert!(default_true);
|
||||
assert_eq!(default_true, true);
|
||||
assert_eq!(!default_true, false);
|
||||
assert!(!!default_true);
|
||||
|
||||
if !(*default_true) {
|
||||
unreachable!("default_true is false")
|
||||
}
|
||||
|
||||
let mut default_true = DefaultTrue::default();
|
||||
*default_true = false;
|
||||
assert!(!default_true);
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
pub mod controller;
|
||||
mod default_true;
|
||||
mod project;
|
||||
pub mod storage;
|
||||
|
||||
|
@ -5,7 +5,7 @@ use std::{
|
||||
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use gitbutler_core::types::default_true::DefaultTrue;
|
||||
use crate::default_true::DefaultTrue;
|
||||
use gitbutler_id::id::Id;
|
||||
|
||||
#[derive(Debug, Clone, Default, Serialize, Deserialize, PartialEq)]
|
||||
|
Loading…
Reference in New Issue
Block a user