change name of functions

This commit is contained in:
grimhilt 2023-10-21 21:48:21 +02:00
parent 9ea1d01c27
commit 908ead5b11
14 changed files with 46 additions and 10 deletions

22
Cargo.lock generated
View File

@ -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"

View File

@ -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

View File

@ -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;

View File

@ -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)) => {

View File

@ -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)) => {

View File

@ -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)) => {

View File

@ -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)) => {

View File

@ -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)) => {

View File

@ -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)) => {

View File

@ -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;

View File

@ -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)) => {

View File

@ -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};

View File

@ -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;

View File

@ -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() {