organize import order
This commit is contained in:
parent
8b3ba64e48
commit
4842a20024
@ -1,9 +1,9 @@
|
||||
use std::io::Write;
|
||||
use std::path::{Path, PathBuf};
|
||||
use clap::Values;
|
||||
use crate::store;
|
||||
use crate::utils::{self};
|
||||
use crate::utils::nextsyncignore::{self, ignore_file};
|
||||
use crate::store;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::io::Write;
|
||||
|
||||
pub struct AddArgs<'a> {
|
||||
pub files: Values<'a>,
|
||||
|
@ -2,13 +2,13 @@ use std::fs::DirBuilder;
|
||||
use std::path::{Path, PathBuf};
|
||||
use clap::Values;
|
||||
use regex::Regex;
|
||||
use crate::utils::api::ApiProps;
|
||||
use crate::global::global::{DIR_PATH, set_dir_path};
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::req_props::{ReqProps, ObjProps};
|
||||
use crate::services::download_files::DownloadFiles;
|
||||
use crate::store::object::{self, add_blob, add_tree};
|
||||
use crate::commands;
|
||||
use crate::utils::api::ApiProps;
|
||||
use crate::global::global::{DIR_PATH, set_dir_path};
|
||||
use crate::commands::init;
|
||||
|
||||
pub fn clone(remote: Values<'_>) {
|
||||
let d = DIR_PATH.lock().unwrap().clone();
|
||||
@ -81,7 +81,7 @@ pub fn clone(remote: Values<'_>) {
|
||||
// destination path 'path' already exists and is not an empty directory.
|
||||
//std::process::exit(1);
|
||||
} else {
|
||||
commands::init::init();
|
||||
init::init();
|
||||
}
|
||||
} else {
|
||||
// create folder
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::utils::{path, read};
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::{self, Write};
|
||||
use crate::utils::{path, read};
|
||||
|
||||
pub fn set(var: &str, val: &str) -> io::Result<()> {
|
||||
let mut root = match path::nextsync() {
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::env;
|
||||
use std::fs::{DirBuilder, File};
|
||||
use std::path::PathBuf;
|
||||
use std::env;
|
||||
use crate::global::global::DIR_PATH;
|
||||
|
||||
pub fn init() {
|
||||
|
@ -1,10 +1,10 @@
|
||||
use std::fs::File;
|
||||
use crypto::digest::Digest;
|
||||
use crypto::sha1::Sha1;
|
||||
use std::collections::{HashSet, HashMap};
|
||||
use colored::Colorize;
|
||||
use std::path::PathBuf;
|
||||
use std::io::{self, Lines, BufReader};
|
||||
use std::collections::{HashSet, HashMap};
|
||||
use crypto::digest::Digest;
|
||||
use crypto::sha1::Sha1;
|
||||
use colored::Colorize;
|
||||
use crate::utils;
|
||||
use crate::store::{self, object};
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
use clap::{App, Arg, SubCommand};
|
||||
use crate::commands::add::AddArgs;
|
||||
|
||||
mod commands;
|
||||
mod utils;
|
||||
mod services;
|
||||
|
@ -1,9 +1,9 @@
|
||||
use std::env;
|
||||
use dotenv::dotenv;
|
||||
use reqwest::Client;
|
||||
use reqwest::RequestBuilder;
|
||||
use reqwest::{Response, Error, IntoUrl, Method};
|
||||
use crate::utils::api::ApiProps;
|
||||
use std::env;
|
||||
use dotenv::dotenv;
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum ApiError {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
use reqwest::{Method, IntoUrl, Response, Error};
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
|
||||
pub struct CreateFolder {
|
||||
api_builder: ApiBuilder,
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
use reqwest::{Method, Response, Error};
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
|
||||
pub struct DeletePath {
|
||||
api_builder: ApiBuilder,
|
||||
|
@ -1,9 +1,9 @@
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
use std::path::PathBuf;
|
||||
use reqwest::{Method, Response, Error};
|
||||
use crate::utils::api::ApiProps;
|
||||
use std::fs::OpenOptions;
|
||||
use std::io::{self, Write};
|
||||
use reqwest::{Method, Response, Error};
|
||||
use crate::utils::api::ApiProps;
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
|
||||
pub struct DownloadFiles {
|
||||
api_builder: ApiBuilder,
|
||||
|
@ -1,10 +1,10 @@
|
||||
use std::io::Cursor;
|
||||
use xml::reader::{EventReader, XmlEvent};
|
||||
use reqwest::{Method, Response, Error};
|
||||
use chrono::{Utc, DateTime};
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
use reqwest::{Method, Response, Error};
|
||||
use xml::reader::{EventReader, XmlEvent};
|
||||
use crate::utils::time::parse_timestamp;
|
||||
use crate::utils::api::{get_relative_s, ApiProps};
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct ObjProps {
|
||||
|
@ -1,8 +1,8 @@
|
||||
use std::fs::File;
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
use std::path::PathBuf;
|
||||
use std::io::{Read};
|
||||
use std::path::PathBuf;
|
||||
use reqwest::{Method, Response, Error};
|
||||
use crate::services::api::{ApiBuilder, ApiError};
|
||||
|
||||
pub struct UploadFile {
|
||||
api_builder: ApiBuilder,
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::path::PathBuf;
|
||||
use crate::utils::{read, path};
|
||||
use std::fs::{File, OpenOptions};
|
||||
use std::io::{self, Write};
|
||||
use crate::utils::{read, path};
|
||||
|
||||
pub fn _read_only(mut path: PathBuf) -> File {
|
||||
path.push("HEAD");
|
||||
|
@ -1,8 +1,8 @@
|
||||
use std::fs::OpenOptions;
|
||||
use std::io;
|
||||
use std::fs::File;
|
||||
use std::fs::OpenOptions;
|
||||
use std::path::PathBuf;
|
||||
use crate::utils::{read, path};
|
||||
use std::io;
|
||||
|
||||
pub fn _read_only(mut path: PathBuf) -> File {
|
||||
path.push("index");
|
||||
|
@ -1,11 +1,11 @@
|
||||
use std::fs::File;
|
||||
use std::io::{self, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use crate::utils::{read, path};
|
||||
use crate::store::head;
|
||||
use std::fs::{OpenOptions, self};
|
||||
use crypto::sha1::Sha1;
|
||||
use crypto::digest::Digest;
|
||||
use std::fs::{OpenOptions, self};
|
||||
use std::io::{self, Write};
|
||||
use std::fs::File;
|
||||
use crate::utils::{read, path};
|
||||
use crate::store::head;
|
||||
|
||||
/// Returns (line, hash, name)
|
||||
///
|
||||
|
@ -1,7 +1,7 @@
|
||||
use crate::utils::path;
|
||||
use regex::Regex;
|
||||
use std::fs::File;
|
||||
use std::io::{BufReader, BufRead};
|
||||
use regex::Regex;
|
||||
use crate::utils::path;
|
||||
|
||||
pub fn read_lines() -> Result<Vec<String>, ()> {
|
||||
if let Some(path) = path::nextsyncignore() {
|
||||
|
@ -1,7 +1,7 @@
|
||||
use std::env;
|
||||
use std::fs::canonicalize;
|
||||
use std::path::{PathBuf, Path};
|
||||
use crate::global::global::DIR_PATH;
|
||||
use std::fs::canonicalize;
|
||||
|
||||
pub fn current() -> Option<PathBuf> {
|
||||
let d = DIR_PATH.lock().unwrap();
|
||||
|
@ -1,6 +1,6 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::io::{self, BufRead, BufReader, Write};
|
||||
use std::fs::{self, File, OpenOptions};
|
||||
use std::io::{self, BufRead, BufReader, Write};
|
||||
|
||||
pub fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
|
||||
where P: AsRef<Path>, {
|
||||
|
Loading…
Reference in New Issue
Block a user