Skip to content

Commit

Permalink
revert change package name from carbone-sdk-rust to carbone_sdk_rust.…
Browse files Browse the repository at this point in the history
… Update documentations and tests imports with the new name
  • Loading branch information
pascal-chenevas committed Oct 1, 2023
1 parent 991eb1d commit d2658da
Show file tree
Hide file tree
Showing 15 changed files with 117 additions and 122 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "carbone_sdk_rs"
name = "carbone-sdk-rust"
version = "0.1.0"
edition = "2021"
authors = ["Pascal Chenevas-Paule <pcp.dev@posteo.de>"]
Expand Down
75 changes: 37 additions & 38 deletions src/blocking/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::blocking::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::blocking::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::template::TemplateId;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down Expand Up @@ -112,11 +112,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::blocking::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::blocking::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::template::TemplateId;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down Expand Up @@ -167,13 +167,13 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::render::*;
/// use carbone_sdk_rs::blocking::Carbone;
/// use carbone_sdk_rs::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rs::template::{TemplateFile,TemplateId};
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::render::*;
/// use carbone_sdk_rust::blocking::Carbone;
/// use carbone_sdk_rust::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rust::template::{TemplateFile,TemplateId};
///
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down Expand Up @@ -212,7 +212,6 @@ impl<'a> Carbone<'a> {
json_data: JsonData,
payload: Option<&str>,
) -> Result<Bytes> {

let template_id_generated = template_file.generate_id(payload)?;

let result = self.download_template(&template_id_generated);
Expand All @@ -237,11 +236,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::render::RenderId;
/// use carbone_sdk_rs::blocking::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::render::RenderId;
/// use carbone_sdk_rust::blocking::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down Expand Up @@ -290,13 +289,13 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::render::*;
/// use carbone_sdk_rs::blocking::Carbone;
/// use carbone_sdk_rs::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::render::*;
/// use carbone_sdk_rust::blocking::Carbone;
/// use carbone_sdk_rust::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rust::template::TemplateId;
///
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down Expand Up @@ -347,11 +346,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::blocking::Carbone;
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rs::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rust::blocking::Carbone;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::template::TemplateId;
/// use carbone_sdk_rust::errors::CarboneError;
/// use carbone_sdk_rust::types::{ApiJsonToken, JsonData};
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down Expand Up @@ -416,11 +415,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::blocking::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::template::TemplateFile;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::blocking::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::template::TemplateFile;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down
76 changes: 38 additions & 38 deletions src/carbone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::carbone::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::carbone::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::template::TemplateId;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// #[tokio::main]
/// async fn main() -> Result<(), CarboneError> {
Expand Down Expand Up @@ -109,11 +109,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::carbone::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::carbone::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::template::TemplateId;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// #[tokio::main]
/// async fn main() -> Result<(), CarboneError> {
Expand Down Expand Up @@ -160,13 +160,13 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::render::*;
/// use carbone_sdk_rs::carbone::Carbone;
/// use carbone_sdk_rs::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rs::template::{TemplateFile,TemplateId};
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::render::*;
/// use carbone_sdk_rust::carbone::Carbone;
/// use carbone_sdk_rust::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rust::template::{TemplateFile,TemplateId};
///
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// #[tokio::main]
/// async fn main() -> Result<(), CarboneError> {
Expand Down Expand Up @@ -233,11 +233,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::render::RenderId;
/// use carbone_sdk_rs::carbone::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::render::RenderId;
/// use carbone_sdk_rust::carbone::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// #[tokio::main]
/// async fn main() -> Result<(), CarboneError> {
Expand Down Expand Up @@ -282,14 +282,14 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::render::*;
/// use carbone_sdk_rs::types::JsonData;
/// use carbone_sdk_rs::carbone::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::render::*;
/// use carbone_sdk_rust::types::JsonData;
/// use carbone_sdk_rust::carbone::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::template::TemplateId;
///
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// #[tokio::main]
/// async fn main() -> Result<(), CarboneError> {
Expand Down Expand Up @@ -341,11 +341,11 @@ impl<'a> Carbone<'a> {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::carbone::Carbone;
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rs::types::{ApiJsonToken, JsonData};
/// use carbone_sdk_rust::carbone::Carbone;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::template::TemplateId;
/// use carbone_sdk_rust::errors::CarboneError;
/// use carbone_sdk_rust::types::{ApiJsonToken, JsonData};
///
/// #[tokio::main]
/// async fn main() -> Result<(), CarboneError> {
Expand Down Expand Up @@ -412,11 +412,11 @@ impl<'a> Carbone<'a> {
/// use std::env;
/// use std::fs;
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::carbone::Carbone;
/// use carbone_sdk_rs::types::ApiJsonToken;
/// use carbone_sdk_rs::template::TemplateFile;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::carbone::Carbone;
/// use carbone_sdk_rust::types::ApiJsonToken;
/// use carbone_sdk_rust::template::TemplateFile;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// #[tokio::main]
/// async fn main() -> Result<(), CarboneError> {
Expand Down
18 changes: 9 additions & 9 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ impl Config {
///
/// ```no_run
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rs::types::ApiVersion;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::errors::CarboneError;
/// use carbone_sdk_rust::types::ApiVersion;
///
/// fn main() -> Result<(), CarboneError> {
/// let api_version: ApiVersion = ApiVersion::new("4".to_string())?;
Expand Down Expand Up @@ -63,8 +63,8 @@ impl Config {
///
/// ```no_run
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
/// let config = Config::from_file("tests/config.test.json")?;
Expand All @@ -89,8 +89,8 @@ impl Config {
///
/// ```no_run
///
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down Expand Up @@ -121,8 +121,8 @@ impl Default for Config {
/// ```no_run
///
/// use std::str::FromStr;
/// use carbone_sdk_rs::config::Config;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::config::Config;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down
4 changes: 2 additions & 2 deletions src/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ impl RenderId {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::render::RenderId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::render::RenderId;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down
6 changes: 2 additions & 4 deletions src/template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ impl TemplateId {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::template::TemplateId;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::template::TemplateId;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand All @@ -85,7 +85,6 @@ impl TemplateId {
}

pub fn from_bytes(data: Vec<u8>, payload: Option<&str>) -> Result<Self> {

let mut sha256 = Sha256::new();

let payload = payload.unwrap_or("");
Expand All @@ -97,7 +96,6 @@ impl TemplateId {
let result: String = format!("{:X}", sha256.finalize());

Self::new(result.to_lowercase())

}
}

Expand Down
4 changes: 2 additions & 2 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ impl JsonData {
/// ```no_run
/// use std::env;
///
/// use carbone_sdk_rs::types::JsonData;
/// use carbone_sdk_rs::errors::CarboneError;
/// use carbone_sdk_rust::types::JsonData;
/// use carbone_sdk_rust::errors::CarboneError;
///
/// fn main() -> Result<(), CarboneError> {
///
Expand Down
9 changes: 4 additions & 5 deletions tests/carbone_response_test.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#[cfg(test)]
mod tests {

use carbone_sdk_rs::carbone_response::{APIResponse, APIResponseData};
use carbone_sdk_rs::errors::CarboneError;
use carbone_sdk_rs::render::RenderId;
use carbone_sdk_rs::template::TemplateId;
use serde_json;
use carbone_sdk_rust::carbone_response::{APIResponse, APIResponseData};
use carbone_sdk_rust::errors::CarboneError;
use carbone_sdk_rust::render::RenderId;
use carbone_sdk_rust::template::TemplateId;

#[test]
fn test_deserialize_response_succeed() -> Result<(), CarboneError> {
Expand Down
Loading

0 comments on commit d2658da

Please sign in to comment.