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

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