Sfoglia il codice sorgente

Rename functions for consistency

master
Dylan Baker 5 anni fa
parent
commit
fd9aaf4b1d
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  1. 4
    4
      src/cli.rs

+ 4
- 4
src/cli.rs Vedi File

4
 
4
 
5
 use crate::client::{build_url_from_config, create_snippet, OutgoingSnippet, ServerConfig};
5
 use crate::client::{build_url_from_config, create_snippet, OutgoingSnippet, ServerConfig};
6
 
6
 
7
-fn get_snippet_from_matches(matches: &ArgMatches) -> io::Result<OutgoingSnippet> {
7
+fn build_snippet_from_matches(matches: &ArgMatches) -> io::Result<OutgoingSnippet> {
8
     let title = matches.value_of("name").unwrap();
8
     let title = matches.value_of("name").unwrap();
9
     let input = matches.value_of("file");
9
     let input = matches.value_of("file");
10
     let filetype = matches.value_of("filetype").unwrap();
10
     let filetype = matches.value_of("filetype").unwrap();
25
     })
25
     })
26
 }
26
 }
27
 
27
 
28
-fn get_server_config_from_matches(matches: &ArgMatches) -> ServerConfig {
28
+fn build_server_config_from_matches(matches: &ArgMatches) -> ServerConfig {
29
     let protocol = matches.value_of("protocol").unwrap();
29
     let protocol = matches.value_of("protocol").unwrap();
30
     let hostname = matches.value_of("hostname").unwrap();
30
     let hostname = matches.value_of("hostname").unwrap();
31
     let port = matches.value_of("port").unwrap();
31
     let port = matches.value_of("port").unwrap();
37
 }
37
 }
38
 
38
 
39
 pub fn new_snippet(matches: &ArgMatches) -> io::Result<()> {
39
 pub fn new_snippet(matches: &ArgMatches) -> io::Result<()> {
40
-    let snippet = get_snippet_from_matches(matches)?;
41
-    let config = get_server_config_from_matches(matches);
40
+    let snippet = build_snippet_from_matches(matches)?;
41
+    let config = build_server_config_from_matches(matches);
42
     let url = build_url_from_config(&config);
42
     let url = build_url_from_config(&config);
43
 
43
 
44
     match create_snippet(snippet, &config) {
44
     match create_snippet(snippet, &config) {

Loading…
Annulla
Salva