瀏覽代碼

Client doesn't need to know about formatted body

master
Dylan Baker 5 年之前
父節點
當前提交
41829fa174
共有 2 個檔案被更改,包括 1 行新增6 行删除
  1. 1
    5
      src/cli.rs
  2. 0
    1
      src/client.rs

+ 1
- 5
src/cli.rs 查看文件

@@ -23,7 +23,6 @@ fn build_snippet_from_matches(matches: &ArgMatches) -> io::Result<OutgoingSnippe
23 23
         title: title.to_string(),
24 24
         body,
25 25
         filetype: filetype.to_string(),
26
-        formatted_body: String::from(""),
27 26
     })
28 27
 }
29 28
 
@@ -45,10 +44,7 @@ pub fn new_snippet(matches: &ArgMatches) -> io::Result<()> {
45 44
 
46 45
     match create_snippet(snippet, &config) {
47 46
         Ok(resp) => match resp {
48
-            ApiResult::IncomingSnippet { id, .. } => println!(
49
-                "Success! Your new snippet is available at {}/snippets/{}",
50
-                url, id
51
-            ),
47
+            ApiResult::IncomingSnippet { id, .. } => println!("{}/snippets/{}", url, id),
52 48
             ApiResult::IncomingError { message } => println!("error: {}", message),
53 49
         },
54 50
         Err(err) => println!("{}", err),

+ 0
- 1
src/client.rs 查看文件

@@ -5,7 +5,6 @@ use serde::{Deserialize, Serialize};
5 5
 pub struct OutgoingSnippet {
6 6
     pub title: String,
7 7
     pub body: String,
8
-    pub formatted_body: String,
9 8
     pub filetype: String,
10 9
 }
11 10
 

Loading…
取消
儲存