change name of functions
This commit is contained in:
parent
9ea1d01c27
commit
908ead5b11
22
Cargo.lock
generated
22
Cargo.lock
generated
@ -641,6 +641,7 @@ dependencies = [
|
||||
"md5",
|
||||
"regex",
|
||||
"reqwest",
|
||||
"rpassword",
|
||||
"rust-crypto",
|
||||
"textwrap 0.13.4",
|
||||
"tokio",
|
||||
@ -915,6 +916,27 @@ dependencies = [
|
||||
"winreg",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rpassword"
|
||||
version = "7.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"rtoolbox",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rtoolbox"
|
||||
version = "0.0.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "034e22c514f5c0cb8a10ff341b9b048b5ceb21591f31c8f44c43b960f9b3524a"
|
||||
dependencies = [
|
||||
"libc",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rust-crypto"
|
||||
version = "0.2.36"
|
||||
|
||||
@ -21,6 +21,7 @@ chrono = "0.4.26"
|
||||
indicatif = "0.17.5"
|
||||
md5 = "0.7.0"
|
||||
futures-util = "0.3.28"
|
||||
rpassword = "7.2"
|
||||
|
||||
[profile.release]
|
||||
debug = true
|
||||
|
||||
@ -10,6 +10,7 @@ use crate::utils::path::path_buf_to_string;
|
||||
use crate::utils::remote::{enumerate_remote, EnumerateOptions};
|
||||
use crate::global::global::{DIR_PATH, set_dir_path};
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::{ReqProps, ObjProps};
|
||||
use crate::store::object::{tree, blob::Blob};
|
||||
use crate::commands::config;
|
||||
|
||||
@ -2,6 +2,7 @@ use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::r#copy::Copy;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::commands::status::LocalObj;
|
||||
use crate::commands::push::push_factory::{PushState, PushChange, PushFlowState};
|
||||
@ -26,10 +27,10 @@ impl PushChange for Copied {
|
||||
fn push(&self) -> io::Result<()> {
|
||||
let obj = &self.obj;
|
||||
let res = Copy::new()
|
||||
.set_url(
|
||||
.set_url_copy(
|
||||
&path_buf_to_string(obj.path_from.clone().unwrap()),
|
||||
obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::delete_path::DeletePath;
|
||||
use crate::store::index;
|
||||
use crate::store::object::blob::Blob;
|
||||
@ -26,7 +27,7 @@ impl PushChange for Deleted {
|
||||
let obj = &self.obj;
|
||||
let res = DeletePath::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::services::upload_file::UploadFile;
|
||||
use crate::commands::status::LocalObj;
|
||||
@ -27,7 +28,7 @@ impl PushChange for Modified {
|
||||
let res = UploadFile::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.set_file(obj.path.clone())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::r#move::Move;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::commands::status::LocalObj;
|
||||
@ -26,10 +27,10 @@ impl PushChange for Moved {
|
||||
fn push(&self) -> io::Result<()> {
|
||||
let obj = &self.obj;
|
||||
let res = Move::new()
|
||||
.set_url(
|
||||
.set_url_move(
|
||||
&path_buf_to_string(obj.path_from.clone().unwrap()),
|
||||
obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::services::upload_file::UploadFile;
|
||||
use crate::store::object::blob::Blob;
|
||||
@ -27,7 +28,7 @@ impl PushChange for New {
|
||||
let res = UploadFile::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.set_file(obj.path.clone())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::services::create_folder::CreateFolder;
|
||||
use crate::store::index;
|
||||
@ -33,7 +34,7 @@ impl PushChange for NewDir {
|
||||
let obj = &self.obj;
|
||||
let res = CreateFolder::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@ -2,6 +2,7 @@ use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::commands::status::{State, LocalObj};
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::ReqProps;
|
||||
use crate::commands::push::new::New;
|
||||
use crate::commands::push::new_dir::NewDir;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
use std::path::PathBuf;
|
||||
use std::io;
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::delete_path::DeletePath;
|
||||
use crate::store::index;
|
||||
use crate::store::object::tree;
|
||||
@ -32,7 +33,7 @@ impl PushChange for RmDir {
|
||||
let obj = &self.obj;
|
||||
let res = DeletePath::new()
|
||||
.set_url(obj.path.to_str().unwrap())
|
||||
.send_with_err();
|
||||
.send();
|
||||
|
||||
match res {
|
||||
Err(ApiError::IncorrectRequest(err)) => {
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
use crate::services::api::ApiError;
|
||||
use crate::services::api_call::ApiCall;
|
||||
use crate::services::req_props::{ReqProps, ObjProps};
|
||||
use crate::store::object::Object;
|
||||
use crate::utils::api::{ApiProps, get_api_props};
|
||||
|
||||
@ -7,4 +7,8 @@ pub mod delete_path;
|
||||
pub mod downloader;
|
||||
pub mod r#move;
|
||||
pub mod r#copy;
|
||||
pub mod login;
|
||||
pub mod request_manager;
|
||||
pub mod api_call;
|
||||
//pub mod auth;
|
||||
//pub mod bulk_upload;
|
||||
|
||||
@ -2,7 +2,6 @@ use std::fs::File;
|
||||
use std::io::{BufReader, BufRead};
|
||||
use regex::Regex;
|
||||
use crate::utils::path;
|
||||
use std::io::Cursor;
|
||||
|
||||
pub fn read_lines() -> Result<Vec<String>, ()> {
|
||||
if let Some(path) = path::nextsyncignore() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user