2222//! ARGS:
2323//! <PAGEID> The ID (e.g. 1234) of the confluence page you want to scan
2424//! <URL> Base URL of Confluence instance (e.g. https://newrelic.atlassian.net/)
25- //! From https://docs.atlassian.com/ConfluenceServer/rest/7.11.0/ Structure of the REST URIs section
26- //! for details on declaring the base url with or without context
27- //! With context: http://host:port/context/rest/api/resource-name
28- //! Or without context: http://host:port/rest/api/resource-name
29- //! Example with context: http://example.com:8080/confluence/rest/api/space/ds
30- //! Example without context: http://confluence.myhost.com:8095/rest/api/space/ds
25+ //! From https://docs.atlassian.com/ConfluenceServer/rest/7.11.0/ Structure of the REST URIs section
26+ //! for details on declaring the base url with or without context
27+ //! With context: http://host:port/context/rest/api/resource-name
28+ //! Or without context: http://host:port/rest/api/resource-name
29+ //! Example with context: http://example.com:8080/confluence/rest/api/space/ds
30+ //! Example without context: http://confluence.myhost.com:8095/rest/api/space/ds
3131
3232#[ macro_use]
3333extern crate clap;
@@ -50,7 +50,6 @@ use serde_json::{Map, Value};
5050use simple_error:: SimpleError ;
5151use std:: collections:: { BTreeMap , HashSet } ;
5252use std:: io:: Read ;
53- use std:: iter:: FromIterator ;
5453use url:: Url ;
5554
5655/// `serde_json` object that represents a single found secret - finding
@@ -112,7 +111,7 @@ fn run(arg_matches: &ArgMatches) -> Result<(), SimpleError> {
112111 let authtoken = arg_matches. value_of ( "BEARERTOKEN" ) ;
113112 let base_url_input = arg_matches
114113 . value_of ( "URL" )
115- . unwrap_or_else ( || "https://confluence.atlassian.com" )
114+ . unwrap_or ( "https://confluence.atlassian.com" )
116115 . trim_end_matches ( '/' ) ;
117116 let base_url_as_url = Url :: parse ( base_url_input) . unwrap ( ) ;
118117 let page_id = arg_matches
@@ -152,7 +151,7 @@ fn run(arg_matches: &ArgMatches) -> Result<(), SimpleError> {
152151 let secrets = get_findings ( & secret_scanner, page_id, content. as_bytes ( ) , & page. web_link ) ;
153152
154153 // combine and output the results
155- let findings: HashSet < ConfluenceFinding > = HashSet :: from_iter ( secrets. into_iter ( ) ) ;
154+ let findings: HashSet < ConfluenceFinding > = secrets. into_iter ( ) . collect ( ) ;
156155 info ! ( "Found {} secrets" , findings. len( ) ) ;
157156 match secret_scanner. output_findings ( & findings) {
158157 Ok ( _) => Ok ( ( ) ) ,
@@ -273,7 +272,7 @@ fn get_findings(
273272 }
274273 if !secrets_for_reason. is_empty ( ) {
275274 secrets. push ( ConfluenceFinding {
276- strings_found : Vec :: from_iter ( secrets_for_reason. iter ( ) . cloned ( ) ) ,
275+ strings_found : secrets_for_reason. iter ( ) . cloned ( ) . collect ( ) ,
277276 page_id : String :: from ( issue_id) ,
278277 reason,
279278 url : String :: from ( web_link) ,
0 commit comments