mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-12 07:14:38 +00:00
cleanup: run rustfmt
This commit is contained in:
parent
88cc9ffcbc
commit
648cfd698c
3 changed files with 7 additions and 5 deletions
|
@ -1,6 +1,5 @@
|
||||||
use bencher::{benchmark_group, benchmark_main, Bencher};
|
use bencher::{benchmark_group, benchmark_main, Bencher};
|
||||||
use criterion_bencher_compat as bencher;
|
use criterion_bencher_compat as bencher;
|
||||||
|
|
||||||
use jujutsu_lib::diff;
|
use jujutsu_lib::diff;
|
||||||
|
|
||||||
fn unchanged_lines(count: usize) -> (String, String) {
|
fn unchanged_lines(count: usize) -> (String, String) {
|
||||||
|
|
|
@ -34,7 +34,6 @@ use thiserror::Error;
|
||||||
use crate::backend::{ChangeId, CommitId};
|
use crate::backend::{ChangeId, CommitId};
|
||||||
use crate::commit::Commit;
|
use crate::commit::Commit;
|
||||||
use crate::file_util::persist_content_addressed_temp_file;
|
use crate::file_util::persist_content_addressed_temp_file;
|
||||||
|
|
||||||
#[cfg(not(feature = "map_first_last"))]
|
#[cfg(not(feature = "map_first_last"))]
|
||||||
use crate::nightly_shims::BTreeSetExt;
|
use crate::nightly_shims::BTreeSetExt;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ pub struct RepoSettings {
|
||||||
_config: config::Config,
|
_config: config::Config,
|
||||||
}
|
}
|
||||||
|
|
||||||
const TOO_MUCH_CONFIG_ERROR: &str = "Both `$HOME/.jjconfig` and `$XDG_CONFIG_HOME/jj/config.toml` were found, please remove one.";
|
const TOO_MUCH_CONFIG_ERROR: &str =
|
||||||
|
"Both `$HOME/.jjconfig` and `$XDG_CONFIG_HOME/jj/config.toml` were found, please remove one.";
|
||||||
|
|
||||||
impl UserSettings {
|
impl UserSettings {
|
||||||
pub fn from_config(config: config::Config) -> Self {
|
pub fn from_config(config: config::Config) -> Self {
|
||||||
|
@ -50,9 +51,12 @@ impl UserSettings {
|
||||||
|
|
||||||
if let Some(home_dir) = dirs::home_dir() {
|
if let Some(home_dir) = dirs::home_dir() {
|
||||||
let p = home_dir.join(".jjconfig");
|
let p = home_dir.join(".jjconfig");
|
||||||
// we already loaded from the new location, prevent user confusion and make them remove the old one:
|
// we already loaded from the new location, prevent user confusion and make them
|
||||||
|
// remove the old one:
|
||||||
if loaded_from_config_dir && p.exists() {
|
if loaded_from_config_dir && p.exists() {
|
||||||
return Err(config::ConfigError::Message(TOO_MUCH_CONFIG_ERROR.to_string()));
|
return Err(config::ConfigError::Message(
|
||||||
|
TOO_MUCH_CONFIG_ERROR.to_string(),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
config.merge(
|
config.merge(
|
||||||
config::File::from(p)
|
config::File::from(p)
|
||||||
|
|
Loading…
Reference in a new issue